From ab2af54ff9e0858297134ff822c95ee1aaf80634 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 11 Jun 2014 14:31:27 +0100 Subject: [PATCH] Set traditional galleries to inline-block to get correct width Prevents over-sized shields. Functionally (but not logically) dependent on I8a532b20 in core. Change-Id: I12a1a76a6dbef9b365035ad8c577243a3420b967 --- VisualEditor.php | 1 + modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js | 3 +++ modules/ve-mw/ce/styles/nodes/ve.ce.MWGalleryNode.css | 11 +++++++++++ 3 files changed, 15 insertions(+) create mode 100644 modules/ve-mw/ce/styles/nodes/ve.ce.MWGalleryNode.css diff --git a/VisualEditor.php b/VisualEditor.php index bbf2fb27e8..f4dc10791d 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -1171,6 +1171,7 @@ $wgResourceModules += array( 'modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js', ), 'styles' => array( + 'modules/ve-mw/ce/styles/nodes/ve.ce.MWGalleryNode.css', 'modules/ve-mw/ui/styles/inspectors/ve.ui.MWGalleryInspector.css', ), 'dependencies' => array( diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js index 61d6290ed7..0e436436a6 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js @@ -18,6 +18,9 @@ ve.ce.MWGalleryNode = function VeCeMWGalleryNode( model, config ) { // Parent constructor ve.ce.MWBlockExtensionNode.call( this, model, config ); + + // DOM changes + this.$element.addClass( 've-ce-mwGalleryNode' ); }; /* Inheritance */ diff --git a/modules/ve-mw/ce/styles/nodes/ve.ce.MWGalleryNode.css b/modules/ve-mw/ce/styles/nodes/ve.ce.MWGalleryNode.css new file mode 100644 index 0000000000..ddee66fa12 --- /dev/null +++ b/modules/ve-mw/ce/styles/nodes/ve.ce.MWGalleryNode.css @@ -0,0 +1,11 @@ +/*! + * VisualEditor ContentEditable MediaWiki MWGalleryNode styles. + * + * @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt + * @license The MIT License (MIT); see LICENSE.txt + */ + +.ve-ce-mwGalleryNode .mw-gallery-traditional { + /* Use inline-block to avoid over-sized shields */ + display: inline-block +} \ No newline at end of file