Proper support for frame images (do not display magnify icon).

Change-Id: I94792760e6b1ff69ab13501939bf8d10e0558e5b
This commit is contained in:
Inez Korczyński 2013-06-04 17:41:35 -07:00
parent 3dfc960576
commit a9812ad4c6

View file

@ -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 () {
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 );
if ( parentType === 'thumb' ) {
this.$magnify.prependTo( this.$ );
}
};
ve.ce.MWImageCaptionNode.prototype.buildMagnify = function() {