mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-30 17:14:42 +00:00
Make sure <figure> has proper dimensions
This commit brings back the sizing of the <figure> in MWBlockImageNode. The figure must have proper size in CE otherwise 'center' and 'none' alignments don't work, and the <figure> stretches across the entire width of the screen. Bug: 65836 Change-Id: Iefed466fce87f265fbd08908f1171867f9d1e1fe
This commit is contained in:
parent
9a8720bf90
commit
186238e90d
|
@ -206,6 +206,13 @@ ve.ce.MWBlockImageNode.prototype.updateSize = function ( dimensions ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$image.css( dimensions );
|
this.$image.css( dimensions );
|
||||||
|
|
||||||
|
// Make sure $figure is sharing the dimensions, otherwise 'middle' and 'none'
|
||||||
|
// positions don't work properly
|
||||||
|
this.$figure.css( {
|
||||||
|
'width': dimensions.width + ( this.captionVisible ? 2 : 0 ),
|
||||||
|
'height': this.captionVisible ? 'auto' : dimensions.height
|
||||||
|
} );
|
||||||
this.$figure.toggleClass( 'mw-default-size', !!this.model.getAttribute( 'defaultSize' ) );
|
this.$figure.toggleClass( 'mw-default-size', !!this.model.getAttribute( 'defaultSize' ) );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue