Skip to content
Permalink
Browse files

Merge branch 't/11814'

  • Loading branch information...
oleq committed Apr 30, 2014
2 parents 1c28d47 + 05d0613 commit 53f341e399dee53b11aa7e8c1bc4876287b26845
Showing with 12 additions and 5 deletions.
  1. +1 −0 CHANGES.md
  2. +11 −5 plugins/image2/plugin.js
@@ -12,6 +12,7 @@ Fixed Issues:
* [#11626](http://dev.ckeditor.com/ticket/11626): Fixed: [Table Resize](http://ckeditor.com/addon/tableresize) sets invalid width.
* [#11872](http://dev.ckeditor.com/ticket/11872): Made [`element.addClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-addClass) chainable symmetrically to [`element.removeClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeClass).
* [#11813](http://dev.ckeditor.com/ticket/11813): Fixed: Link lost while pasting captioned image and restoring undo snapshot ([Enhanced Image](http://ckeditor.com/addon/image2)).
* [#11814](http://dev.ckeditor.com/ticket/11814): Fixed: _Link_ and _Unlink_ entries persistently displayed in [Enhanced Image](http://ckeditor.com/addon/image2) context menu.

Other changes:

@@ -432,9 +432,10 @@
evt.data.image = CKEDITOR.TRISTATE_OFF;

// Integrate context menu items for link.
evt.data.link = CKEDITOR.TRISTATE_OFF;
evt.data.unlink = this.parts.link ?
CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
// Note that widget may be wrapped in a link, which
// does not belong to that widget (#11814).
if ( this.parts.link || this.wrapper.getAscendant( 'a' ) )
evt.data.link = evt.data.unlink = CKEDITOR.TRISTATE_OFF;
} );

// Pass the reference to this widget to the dialog.
@@ -1403,7 +1404,9 @@
editor.getCommand( 'unlink' ).on( 'exec', function( evt ) {
var widget = getFocusedWidget( editor );

if ( !widget )
// Override unlink only when link truly belongs to the widget.
// If wrapped inline widget in a link, let default unlink work (#11814).
if ( !widget || !widget.parts.link )
return;

widget.setData( 'link', null );
@@ -1422,7 +1425,10 @@
if ( !widget )
return;

this.setState( widget.data.link ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
// Note that widget may be wrapped in a link, which
// does not belong to that widget (#11814).
this.setState( widget.data.link || widget.wrapper.getAscendant( 'a' ) ?
CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );

evt.cancel();
} );

0 comments on commit 53f341e

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