编辑器插入外链无反应bug修复

This commit is contained in:
devil_gong 2019-08-21 21:15:17 +08:00
parent c2db6075cb
commit 637b1746a0
3 changed files with 14 additions and 12 deletions

View File

@ -133,7 +133,7 @@
'border': $G('border'), 'border': $G('border'),
'vhSpace': $G('vhSpace'), 'vhSpace': $G('vhSpace'),
'title': $G('title'), 'title': $G('title'),
'align': $G('align') 'align': 'none'
}; };
var img = editor.selection.getRange().getClosedNode(); var img = editor.selection.getRange().getClosedNode();
if (img) { if (img) {

View File

@ -776,7 +776,7 @@ i.file-preview.file-type-psd{
height: 315px; height: 315px;
} }
#videoUrl { #videoUrl {
width: auto; width: calc(100vw - 92px);
} }
#preview { #preview {
width: calc(100% - 150px); width: calc(100% - 150px);

View File

@ -11020,18 +11020,20 @@ UE.commands['imagefloat'] = {
me.execCommand('insertHtml', '<p id="_img_parent_tmp" style="text-align:center">' + pN.innerHTML + '</p>'); me.execCommand('insertHtml', '<p id="_img_parent_tmp" style="text-align:center">' + pN.innerHTML + '</p>');
tmpNode = me.document.getElementById('_img_parent_tmp'); tmpNode = me.document.getElementById('_img_parent_tmp') || null;
tmpNode.removeAttribute('id'); if(tmpNode != null)
tmpNode = tmpNode.firstChild; {
range.selectNode(tmpNode).select(); tmpNode.removeAttribute('id');
//去掉后边多余的元素 tmpNode = tmpNode.firstChild;removeAttribute
next = tmpNode.parentNode.nextSibling;
if (next && domUtils.isEmptyNode(next)) { range.selectNode(tmpNode).select();
domUtils.remove(next); //去掉后边多余的元素
next = tmpNode.parentNode.nextSibling;
if (next && domUtils.isEmptyNode(next)) {
domUtils.remove(next);
}
} }
} }
break; break;
} }