From: Mark Wells Date: Thu, 10 Dec 2015 09:03:17 +0000 (-0800) Subject: Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=93606bc1854625bfffb8316630bbd4d987d161ec;hp=8fd0a2a920cf5e46c36da85f3346f933727e5dc8;p=freeside.git Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x --- diff --git a/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js b/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js index e4ef39167..96c0f42b3 100644 --- a/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js +++ b/httemplate/elements/ckeditor/plugins/blockprotect/plugin.js @@ -133,7 +133,20 @@ } // span function } // elements }); - } + + editor.on( 'afterInsertHtml', 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 ]); + } + }); + + } // afterInit }); // plugins.add }) (); diff --git a/httemplate/elements/htmlarea.html b/httemplate/elements/htmlarea.html index d8b25121a..4f9b72163 100644 --- a/httemplate/elements/htmlarea.html +++ b/httemplate/elements/htmlarea.html @@ -20,7 +20,8 @@ Example: