Skip to content

Commit

Permalink
Fix EZP-23425: Pasting at the end of paragraph in Chrome put the text…
Browse files Browse the repository at this point in the history
… at the beginning
  • Loading branch information
dpobel committed Oct 10, 2014
1 parent c98765c commit 4e2b9e9
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -131,7 +131,7 @@
atd_css_url : {'javascript/plugins/AtD/css/content.css'|ezdesign},
paste_text_linebreaktype : "br",
paste_preprocess : function(pl, o) {ldelim}
var ed = pl.editor, uid, elt, prev;
var ed = pl.editor, uid, elt, prev, bm;
// Strip <a> HTML tags from clipboard content (Happens on Internet Explorer)
o.content = o.content.replace( /(\s[a-z]+=")<a\s[^>]+>([^<]+)<\/a>/gi, '$1$2' );
Expand All @@ -144,6 +144,7 @@
if ( tinymce.isWebKit ) {
uid = tinymce.DOM.uniqueId();
ed.focus();
bm = ed.selection.getBookmark();
ed.execCommand('mceInsertContent', false, '<span id="' + uid + '"></span>');
elt = ed.getDoc().getElementById(uid);
Expand All @@ -157,6 +158,7 @@
}
}
ed.dom.remove(elt);
ed.selection.moveToBookmark(bm);
}
{/literal}
{rdelim},
Expand Down

0 comments on commit 4e2b9e9

Please sign in to comment.