From 483528affe9775525a3cb2f5e2bf55d2b328fa6d Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Wed, 6 Jul 2022 16:04:18 +0200 Subject: [PATCH] Drop StackLayout Gets rid of some unused behaviors that we've already disconnected. Brings the remaining styling into VE files. Bug: T312524 Change-Id: Ie94472019ba41124831621c45713861297219594 --- extension.json | 1 + .../ve.ui.MWTwoPaneTransclusionDialogLayout.js | 5 +---- .../ve-mw/ui/layouts/ve.ui.MWVerticalLayout.js | 16 ++++++++++++++++ .../ve.ui.MWTwoPaneTransclusionDialogLayout.less | 13 ++++++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 modules/ve-mw/ui/layouts/ve.ui.MWVerticalLayout.js diff --git a/extension.json b/extension.json index 5274d3301b..54e72bd9b4 100644 --- a/extension.json +++ b/extension.json @@ -2132,6 +2132,7 @@ "modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js", "modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js", "modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js", + "modules/ve-mw/ui/layouts/ve.ui.MWVerticalLayout.js", "modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js", "modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js", "modules/ve-mw/ui/contextitems/ve.ui.MWTransclusionContextItem.js", diff --git a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js index 70142277af..82827dc447 100644 --- a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js +++ b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js @@ -27,10 +27,7 @@ ve.ui.MWTwoPaneTransclusionDialogLayout = function VeUiMWTwoPaneTransclusionDial this.currentPageName = null; this.pages = {}; this.ignoreFocus = false; - this.stackLayout = new OO.ui.StackLayout( { - continuous: true, - expanded: this.expanded - } ); + this.stackLayout = new ve.ui.MWVerticalLayout(); this.setContentPanel( this.stackLayout ); this.sidebar = new ve.ui.MWTransclusionOutlineWidget(); this.outlineVisible = false; diff --git a/modules/ve-mw/ui/layouts/ve.ui.MWVerticalLayout.js b/modules/ve-mw/ui/layouts/ve.ui.MWVerticalLayout.js new file mode 100644 index 0000000000..11365f31c4 --- /dev/null +++ b/modules/ve-mw/ui/layouts/ve.ui.MWVerticalLayout.js @@ -0,0 +1,16 @@ +/** + * Container for a vertical series of PageLayouts, similar to OO.ui.HorizontalLayout + */ +ve.ui.MWVerticalLayout = function VeUiMwVerticalLayout() { + // Parent constructor + ve.ui.MWVerticalLayout.super.call( this, { scrollable: true } ); + + // Mixin constructors + OO.ui.mixin.GroupElement.call( this, { $group: this.$element } ); + + // Initialization + this.$element.addClass( 've-ui-mwVerticalLayout' ); +}; + +OO.inheritClass( ve.ui.MWVerticalLayout, OO.ui.PanelLayout ); +OO.mixinClass( ve.ui.MWVerticalLayout, OO.ui.mixin.GroupElement ); diff --git a/modules/ve-mw/ui/styles/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.less b/modules/ve-mw/ui/styles/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.less index bb7ca91eb2..08eec1470c 100644 --- a/modules/ve-mw/ui/styles/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.less +++ b/modules/ve-mw/ui/styles/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.less @@ -19,9 +19,16 @@ /* We don't want anything to collapse left/right, so shouldn't use margin */ padding: 0 48px; - &.oo-ui-stackLayout-continuous > .oo-ui-panelLayout-scrollable { - // Override from PanelLayout; only the StackLayout must be scrollable - overflow: hidden; + &.ve-ui-mwVerticalLayout { + > .oo-ui-panelLayout-scrollable { + // Override from PanelLayout; only the StackLayout must be scrollable + overflow: hidden; + } + + > .oo-ui-panelLayout { + display: block; + position: relative; + } } > .oo-ui-panelLayout {