From a0c0465d67b744985a52db8d73144bd8b9212c1e Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Wed, 6 Jul 2022 09:48:55 +0200 Subject: [PATCH] Don't access the stacklayout directly Bug: T310867 Change-Id: I95cbdee26ead46c2d8803ddb3a9e06304f793407 --- modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js | 2 +- modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js | 2 +- .../layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js index ef3f2e3725..8393c0a1f4 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -74,7 +74,7 @@ ve.ui.MWTemplateDialog.prototype.getReadyProcess = function ( data ) { this.bookletLayout.focus(); } - this.bookletLayout.stackLayout.getItems().forEach( function ( page ) { + this.bookletLayout.getPagesOrdered().forEach( function ( page ) { if ( page instanceof ve.ui.MWParameterPage ) { page.updateSize(); } diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js index c452b0e0e3..febec33002 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js @@ -586,7 +586,7 @@ ve.ui.MWTransclusionDialog.prototype.onWindowResize = function () { if ( this.transclusionModel ) { this.autoExpandSidebar(); - this.bookletLayout.stackLayout.getItems().forEach( function ( page ) { + this.bookletLayout.getPagesOrdered().forEach( function ( page ) { if ( page instanceof ve.ui.MWParameterPage ) { page.updateSize(); } diff --git a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js index aa9d0fa8cf..4018fcffab 100644 --- a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js +++ b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js @@ -208,6 +208,15 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getOutlineControls = function return this.outlineControlsWidget; }; +/** + * Get the list of pages on the stack ordered by appearance. + * + * @return {OO.ui.PageLayout[]} + */ +ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.getPagesOrdered = function () { + return this.stackLayout.getItems(); +}; + /** * Get a page by its symbolic name. *