From 8ab6e86f87e7505ef8aeafa7e33c730b20d6c9a2 Mon Sep 17 00:00:00 2001 From: iseulde Date: Wed, 1 Mar 2017 19:47:36 +0100 Subject: [PATCH] Add undo levels for moving blocks --- tinymce-single/tinymce/block.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tinymce-single/tinymce/block.js b/tinymce-single/tinymce/block.js index 201a752d84167..46b2af369d18e 100644 --- a/tinymce-single/tinymce/block.js +++ b/tinymce-single/tinymce/block.js @@ -166,7 +166,10 @@ $prev = $blocks.first().prev(); if ( $prev.length ) { - $blocks.last().after( $prev ); + editor.undoManager.transact( function() { + $blocks.last().after( $prev ); + } ); + editor.nodeChanged(); window.scrollBy( 0, - rect.top + element.getBoundingClientRect().top ); } @@ -178,7 +181,10 @@ $next = $blocks.last().next(); if ( $next.length ) { - $blocks.first().before( $next ); + editor.undoManager.transact( function() { + $blocks.first().before( $next ); + } ); + editor.nodeChanged(); window.scrollBy( 0, - rect.top + element.getBoundingClientRect().top ); }