Skip to content

Commit

Permalink
Merge branch 't/11813'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Apr 30, 2014
2 parents 06bdff1 + 05c6378 commit 1c28d47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -11,6 +11,7 @@ Fixed Issues:
* [#11801](http://dev.ckeditor.com/ticket/11801): Fixed: Editor anchors unavailable when linking [Enhanced Image](http://ckeditor.com/addon/image2) widget.
* [#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)).

Other changes:

Expand Down
10 changes: 5 additions & 5 deletions plugins/image2/plugin.js
Expand Up @@ -325,7 +325,7 @@
// is destroyed and re-inited.
if ( !this.data.link ) {
if ( this.parts.link )
this.parts.link = null;
delete this.parts.link;
} else {
if ( !this.parts.link )
this.parts.link = this.parts.image.getParent();
Expand Down Expand Up @@ -373,10 +373,10 @@
// If we used 'a' in widget#parts definition, it could happen that
// selected element is a child of widget.parts#caption. Since there's no clever
// way to solve it with CSS selectors, it's done like that. (#11783).
this.parts.link = this.element.is( 'a' ) ?
this.element : this.element.getFirst( function( el ) {
return el.is( 'a' );
} );
var link = image.getAscendant( 'a' );

if ( link && this.wrapper.contains( link ) )
this.parts.link = link;

// Depending on configuration, read style/class from element and
// then remove it. Removed style/class will be set on wrapper in #data listener.
Expand Down

0 comments on commit 1c28d47

Please sign in to comment.