From: Mark Wells Date: Thu, 10 Dec 2015 09:01:29 +0000 (-0800) Subject: Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into 3.x X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=e7bad3b31830cd1c838c607a3336413a4c5ed50c;hp=311a694bf1cb816a48efca116e260d940c5a646f Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into 3.x --- diff --git a/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js b/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js index e4ef39167..d0c9a02b8 100644 --- a/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js +++ b/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js @@ -133,7 +133,21 @@ } // span function } // elements }); - } + + editor.on( 'insertHtml', function( evt ) { + // if this leaves an open SPAN, move the cursor + // to after it + var range = editor.getSelection().getRanges()[0]; + var ec = range.endContainer; + if ( ec.hasClass('cke_blockprotect') ) { + range.setEndAfter(ec); + range.collapse(); + editor.getSelection().selectRanges([ range ]); + } + }, null, null, 30); + // actually inserting the HTML happens at priority 10. + + } // afterInit }); // plugins.add }) (); diff --git a/httemplate/elements/htmlarea.html b/httemplate/elements/htmlarea.html index c98993d40..0ba417795 100644 --- a/httemplate/elements/htmlarea.html +++ b/httemplate/elements/htmlarea.html @@ -20,7 +20,8 @@ Example: