Skip to content

Commit

Permalink
Merge branch 't/11783' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Apr 10, 2014
2 parents d1b421a + 60b54e1 commit e20ae7b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/image2/plugin.js
Expand Up @@ -290,8 +290,8 @@

parts: {
image: 'img',
caption: 'figcaption',
link: 'a'
caption: 'figcaption'
// parts#link defined in widget#init
},

// The name of this widget's dialog.
Expand Down Expand Up @@ -370,6 +370,14 @@
lock: this.ready ? helpers.checkHasNaturalRatio( image ) : true
};

// 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' );
} );

// Depending on configuration, read style/class from element and
// then remove it. Removed style/class will be set on wrapper in #data listener.
// Note: Center alignment is detected during upcast, so only left/right cases
Expand Down

0 comments on commit e20ae7b

Please sign in to comment.