diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js index b0b12ea08a..f03404b3ab 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js @@ -206,6 +206,13 @@ ve.ce.MWBlockImageNode.prototype.updateSize = function ( 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' ) ); };