Skip to content

Commit

Permalink
Keep the selection on drop
Browse files Browse the repository at this point in the history
  • Loading branch information
mimo84 committed Mar 13, 2017
1 parent fa017ec commit bef6be3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tinymce-single/tinymce/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -332,6 +332,7 @@

DOM.bind( outline, 'mousedown', function( event ) {
var newEvent = Object.assign( {}, event );
beforeSelection = editor.selection.getBookmark();

if ( hover ) {
dragTarget = hoverTarget;
Expand Down Expand Up @@ -378,7 +379,7 @@
$draggedNode[0].removeAttribute( 'contenteditable' );
}
}

editor.selection.moveToBookmark(beforeSelection);
editor.nodeChanged();
} );
}
Expand Down

0 comments on commit bef6be3

Please sign in to comment.