Mooeypoo has uploaded a new change for review. https://gerrit.wikimedia.org/r/102481
Change subject: [wip] <figure> css fixes ...................................................................... [wip] <figure> css fixes Some corrections were done to frameless images and right/left-aligned images to try and force firefox to not use its own styles on these. Change-Id: I52e0e10b465bb9761c2e4be28c98bec37b0dd2ca --- M modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js M modules/ve-mw/ce/styles/ve.ce.Node.css 2 files changed, 30 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/81/102481/1 diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js index 70dd782..a9fddfd 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js @@ -62,12 +62,6 @@ this.$element .addClass( 've-ce-mwBlockImageNode-align-' + this.alignment ); - // Update size: - this.updateSize( this.size.height, this.size.width ); - - // Mixin constructors - ve.ce.MWImageNode.call( this, this.$figure, this.$image ); - // I smell a caption! this.$figcaption = this.$( '<figcaption> '); @@ -80,6 +74,12 @@ } else { this.setCaptionVisible( false ); } + + // Update size: + this.updateSize( this.size.height, this.size.width ); + + // Mixin constructors + ve.ce.MWImageNode.call( this, this.$figure, this.$image ); // Events this.model.connect( this, { 'attributeChange': 'onAttributeChange' } ); @@ -232,9 +232,20 @@ this.$figure .css( { - 'width': width + 5 + 'width': width } ); + if ( !this.caption.visible ) { + this.$figure + .css( { + 'height': height + } ); + } else { + this.$figure + .css( { + 'height': 'auto' + } ); + } // update: this.size = { height: height, diff --git a/modules/ve-mw/ce/styles/ve.ce.Node.css b/modules/ve-mw/ce/styles/ve.ce.Node.css index e39471f..8a6d42d 100644 --- a/modules/ve-mw/ce/styles/ve.ce.Node.css +++ b/modules/ve-mw/ce/styles/ve.ce.Node.css @@ -48,6 +48,12 @@ /* ve.ce.MWBlockImageNode */ .ve-ce-mwBlockImageNode { + margin: 0; + padding: 0; + border: none; +} + +figure[typeof*='mw:Image'] { margin: 5px; } @@ -55,6 +61,7 @@ figure[typeof*='mw:Image'].mw-halign-right { clear: right; float: right; + margin-right: 0; } figure[typeof*='mw:Image'].mw-halign-center { @@ -66,6 +73,7 @@ figure[typeof*='mw:Image'].mw-halign-left { clear: left; float: left; + margin-left: 0; } figure[typeof='mw:Image/Thumb'], figure[typeof='mw:Image/Frame'] { @@ -76,6 +84,9 @@ font-size: 94%; text-align: center; } +figure[typeof='mw:Image/Frameless'] { + border: 0; +} figure[typeof*='mw:Image'] figcaption { border: medium none; @@ -84,7 +95,7 @@ padding: 3px !important; } -figure[typeof*='mw:Image'] img { +figure[typeof*='mw:Image']:not( [typeof='mw:Image/Frameless'] ) img { border: 1px solid #cccccc; vertical-align: middle; } -- To view, visit https://gerrit.wikimedia.org/r/102481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52e0e10b465bb9761c2e4be28c98bec37b0dd2ca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Mooeypoo <mor...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits