diff --git a/tinymce-single/tinymce/block.js b/tinymce-single/tinymce/block.js index 9a1ae18ba90352..e1ac3d70f459f5 100644 --- a/tinymce-single/tinymce/block.js +++ b/tinymce-single/tinymce/block.js @@ -312,7 +312,7 @@ editor.buttons.link.icon = 'gridicons-link'; var blockToolbarWidth = 0; - + var beforeSelection; function createBlockOutline( hover ) { var outline = document.createElement( 'div' ); var handleLeft = document.createElement( 'div' ); @@ -332,6 +332,7 @@ DOM.bind( outline, 'mousedown', function( event ) { var newEvent = Object.assign( {}, event ); + beforeSelection = editor.selection.getBookmark(); if ( hover ) { dragTarget = hoverTarget; @@ -378,7 +379,7 @@ $draggedNode[0].removeAttribute( 'contenteditable' ); } } - + editor.selection.moveToBookmark(beforeSelection); editor.nodeChanged(); } ); }