bug#2854:在同一页面中同时打开新建帖子和回复帖子的编辑器,在新建帖子的编辑器中贴图,在第二个编辑器中却显示多个贴的图片

This commit is contained in:
yutao 2015-06-16 16:53:20 +08:00
parent 9606ce1caa
commit 0f8061094d
1 changed files with 7 additions and 1 deletions

View File

@ -293,7 +293,13 @@ https://github.com/layerssss/paste.js
KindEditor.plugin('paste', function(K) {
var editor = this,
name = 'paste';
var contentWindow = document.getElementsByTagName('iframe')[0].contentWindow;
//这样貌似多编辑器就不会冲突了
if(editor.edit == undefined || editor.edit.iframe == undefined){
return;
}
var contentWindow = editor.edit.iframe[0].contentWindow;
//var contentWindow = editor.iframeDoc;
//var contentWindow = document.getElementsByTagName('iframe')[0].contentWindow;
var nodeBody = contentWindow.document.getElementsByTagName('body')[0];
console.log(nodeBody);
$(nodeBody).pastableContenteditable();