diff --git a/CHANGES.md b/CHANGES.md index 2c69a9daae0..1829e4a1257 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ Fixed Issues: * [#11983](http://dev.ckeditor.com/ticket/11983): Fixed: Clicking a nested widget does not focus it. Additionally, performance of the [`widget.repository.getByElement()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.repository-method-getByElement) method has been improved. * [#12000](http://dev.ckeditor.com/ticket/12000): Fixed: Nested widgets should be initialized on [`editor.setData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setData) and [`nestedEditable.setData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.nestedEditable-method-setData). +* [#12022](http://dev.ckeditor.com/ticket/12022): Fixed: Outer widget's drag handler is not created at all if it has any nested widgets inside. * [#11960](http://dev.ckeditor.com/ticket/11960): [Blink/Webkit] Fixed: The caret should be scrolled into view on *Backspace* and *Delete* (covers only the merging blocks case). * [#11306](http://dev.ckeditor.com/ticket/11306): [OSX][Blink/Webkit] Fixed: No widget's entries in context menu on widget right-click. * [#11957](http://dev.ckeditor.com/ticket/11957): Fixed: Alignment labels in the [Enhanced Image](http://ckeditor.com/addon/image2) dialog are not translated. diff --git a/plugins/widget/plugin.js b/plugins/widget/plugin.js index 139184042db..76a8430fab2 100644 --- a/plugins/widget/plugin.js +++ b/plugins/widget/plugin.js @@ -2017,6 +2017,11 @@ return element.type == CKEDITOR.NODE_ELEMENT && element.hasAttribute( 'data-cke-widget-drag-handler' ); } + // @param {CKEDITOR.dom.element} + function isDomDragHandlerContainer( element ) { + return element.type == CKEDITOR.NODE_ELEMENT && element.hasClass( 'cke_widget_drag_handler_container' ); + } + function finalizeNativeDrop( editor, sourceWidget, range ) { // Save the snapshot with the state before moving widget. // Focus widget, so when we'll undo the DnD, widget will be focused. @@ -2852,7 +2857,8 @@ return; var editor = widget.editor, - container = widget.wrapper.findOne( '.cke_widget_drag_handler_container' ), + // Use getLast to find wrapper's direct descendant (#12022). + container = widget.wrapper.getLast( isDomDragHandlerContainer ), img; // Reuse drag handler if already exists (#11281).