From 8448f513a4595da9535f6c6c0e28ead11046072c Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Mon, 4 Jul 2022 13:30:04 +0200 Subject: [PATCH] Two-pane layout setPage has all the desired side-effects This becomes the canonical method to call when we want to update the template dialog to select a new item. Bug: T311987 Change-Id: Ie7880bfde41b77f0e6367cc8e3a78edb299391ce --- .../ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js index 2ab294500b..4b0db0528a 100644 --- a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js +++ b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js @@ -358,7 +358,7 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.clearPages = function () { }; /** - * Set the current page by symbolic name. Doesn't focus the input. + * Set the current page and sidebar selection, by symbolic name. Doesn't focus the input. * * @param {string} name Symbolic name of page */ @@ -385,8 +385,9 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.setPage = function ( name ) { } } } + page.scrollElementIntoView(); page.setActive( true ); - this.onStackLayoutSet( page ); + this.sidebar.setSelectionByPageName( name ); this.refreshControls(); };