Skip to content
Permalink
Browse files

Merge branch 't/13129'

  • Loading branch information...
oleq committed Jul 6, 2015
2 parents 9d62060 + 89c1cc7 commit 507dd1969de2542b8c06182185708a2e3f455961
Showing with 11 additions and 7 deletions.
  1. +1 −0 CHANGES.md
  2. +0 −6 plugins/widget/plugin.js
  3. +10 −1 tests/plugins/widget/dnd.js
@@ -7,6 +7,7 @@ Fixed Issues:

* [#13434](http://dev.ckeditor.com/ticket/13434): Fixed: Dialog state indicator broken in Right–To–Left environments.
* [#13434](http://dev.ckeditor.com/ticket/13434): [IE8-9] Fixed: One drag&drop operation may affect following ones.
* [#13129](http://dev.ckeditor.com/ticket/13129) Fixed: Block widget blurred after drop followed by undo.

## CKEditor 4.5.1

@@ -3234,12 +3234,6 @@
// and save this state as the one where we want to be taken back when undoing.
this.focus();

// Reset the fake selection, which will be invalidated by insertElementIntoRange.
// This avoids a situation when getSelection() still returns a fake selection made
// on widget which in the meantime has been moved to other place. That could cause
// an error thrown e.g. by saveSnapshot or stateUpdater.
editor.getSelection().reset();

// Drag range will be set in the drop listener.
editor.fire( 'drop', {
dropRange: dropRange,
@@ -448,6 +448,9 @@
editor.focus();

try {
// Testing if widget is selected is meaningful only if it is not selected at the beginning. (#13129)
assert.isNull( editor.widgets.focused, 'widget not focused before mousedown' );

img.fire( 'mousedown' );

// Create dummy line and pretend it's visible to cheat drop listener
@@ -456,12 +459,18 @@

editor.document.fire( 'mouseup' );

assert.areSame( widget, editor.widgets.focused, 'widget focused after mouseup' );

bender.tools.resumeAfter( editor, 'afterPaste', function() {
assert.isTrue( pasteCounter.calledOnce, 'paste called once' );
assert.isTrue( dragstartCounter.calledOnce, 'dragstart called once' );
assert.isTrue( dragendCounter.calledOnce, 'dragend called once' );
assert.isTrue( dropCounter.calledOnce, 'drop called once' );
assert.areSame( '<div data-widget="testwidget" id="w1">bar</div><p id="a">foo</p>', editor.getData(), 'Widget moved on drop.' );

// Check if widget is still selected after undo. (#13129)
editor.execCommand( 'undo' );
assert.areSame( getWidgetById( editor, 'w1' ), editor.widgets.focused, 'widget focused after undo' );
} );

wait();
@@ -541,4 +550,4 @@
} );
}
} );
} )();
} )();

0 comments on commit 507dd19

Please sign in to comment.
You can’t perform that action at this time.