mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Proper support for frame images (do not display magnify icon).
Change-Id: I94792760e6b1ff69ab13501939bf8d10e0558e5b
This commit is contained in:
parent
3dfc960576
commit
a9812ad4c6
|
@ -37,19 +37,26 @@ ve.ce.MWImageCaptionNode.static.tagName = 'div';
|
|||
/* Methods */
|
||||
|
||||
/**
|
||||
* TODO: Magnify should not be built nor appended if this is a caption of frame (vs. thumb) image.
|
||||
* TODO: Magnify should appear/disappear based on the changes/updates to the parent (switching to
|
||||
* and from thumb or frame).
|
||||
*/
|
||||
ve.ce.MWImageCaptionNode.prototype.onSplice = function () {
|
||||
if ( this.$magnify ) {
|
||||
this.$magnify.detach();
|
||||
} else {
|
||||
this.buildMagnify();
|
||||
var parentType = this.model.getParent().getAttribute( 'type' );
|
||||
|
||||
if ( parentType === 'thumb' ) {
|
||||
if ( this.$magnify ) {
|
||||
this.$magnify.detach();
|
||||
} else {
|
||||
this.buildMagnify();
|
||||
}
|
||||
}
|
||||
|
||||
// Call parent implementation
|
||||
ve.ce.BranchNode.prototype.onSplice.apply( this, arguments );
|
||||
|
||||
this.$magnify.prependTo( this.$ );
|
||||
if ( parentType === 'thumb' ) {
|
||||
this.$magnify.prependTo( this.$ );
|
||||
}
|
||||
};
|
||||
|
||||
ve.ce.MWImageCaptionNode.prototype.buildMagnify = function() {
|
||||
|
|
Loading…
Reference in a new issue