diff --git a/dist/bundle.js b/dist/bundle.js index a76b7c0908..c025ad8e9f 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -80161,6 +80161,13 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { } }, + _get$Sel: function () { + var o = this.options; + var instance = o.editor.selectedInstance; + var sel = $(instance.selElm()); + return sel; + }, + addParam: function (param) { var o = this.options; var instance = o.editor.instance; @@ -80169,7 +80176,14 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { image.src = attrs.src; image.alt = param; image.style = attrs.style; - instance.getElm().element.append(image); + + var sel = this._get$Sel(); + var wrapper = o.editor.instance.getElm().element; + if (wrapper.find(sel).length <= 0) { + wrapper.append(image); + } else { + sel.after(image); + } this._addBlank($(image)); } }); diff --git a/dist/case.js b/dist/case.js index 936c939f06..05265a71d6 100644 --- a/dist/case.js +++ b/dist/case.js @@ -9959,6 +9959,13 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { } }, + _get$Sel: function () { + var o = this.options; + var instance = o.editor.selectedInstance; + var sel = $(instance.selElm()); + return sel; + }, + addParam: function (param) { var o = this.options; var instance = o.editor.instance; @@ -9967,7 +9974,14 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { image.src = attrs.src; image.alt = param; image.style = attrs.style; - instance.getElm().element.append(image); + + var sel = this._get$Sel(); + var wrapper = o.editor.instance.getElm().element; + if (wrapper.find(sel).length <= 0) { + wrapper.append(image); + } else { + sel.after(image); + } this._addBlank($(image)); } }); diff --git a/dist/fineui.js b/dist/fineui.js index e1e0b43123..61687f2541 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -81925,6 +81925,13 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { } }, + _get$Sel: function () { + var o = this.options; + var instance = o.editor.selectedInstance; + var sel = $(instance.selElm()); + return sel; + }, + addParam: function (param) { var o = this.options; var instance = o.editor.instance; @@ -81933,7 +81940,14 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { image.src = attrs.src; image.alt = param; image.style = attrs.style; - instance.getElm().element.append(image); + + var sel = this._get$Sel(); + var wrapper = o.editor.instance.getElm().element; + if (wrapper.find(sel).length <= 0) { + wrapper.append(image); + } else { + sel.after(image); + } this._addBlank($(image)); } }); diff --git a/src/case/richeditor/bar/action.richeditor.param.js b/src/case/richeditor/bar/action.richeditor.param.js index 8951327b48..222774ff30 100644 --- a/src/case/richeditor/bar/action.richeditor.param.js +++ b/src/case/richeditor/bar/action.richeditor.param.js @@ -30,6 +30,13 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { } }, + _get$Sel: function () { + var o = this.options; + var instance = o.editor.selectedInstance; + var sel = $(instance.selElm()); + return sel; + }, + addParam: function (param) { var o = this.options; var instance = o.editor.instance; @@ -38,7 +45,14 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { image.src = attrs.src; image.alt = param; image.style = attrs.style; - instance.getElm().element.append(image); + + var sel = this._get$Sel(); + var wrapper = o.editor.instance.getElm().element; + if (wrapper.find(sel).length <= 0) { + wrapper.append(image); + } else { + sel.after(image); + } this._addBlank($(image)); } });