From d138cd04bf1bd7c44c63b8148efa9baf8656be3f Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Tue, 28 Jun 2022 15:31:54 +0200 Subject: [PATCH] Fixes for focusPart We missed some usages. Follows up on I5f05bc119dc213d8 Change-Id: Iaecb804300c37d43108a14e8db0068deb58f503c --- modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js index 4fcbb2e417..13c651ab37 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js @@ -96,7 +96,8 @@ ve.ui.MWTransclusionDialog.prototype.onOutlineControlsMove = function ( places ) // Move part to new location, and if dialog is loaded switch to new part page var promise = this.transclusionModel.addPart( part, newPlace ); if ( this.loaded && !this.preventReselection ) { - promise.done( this.focusPart.bind( this, part.getId() ) ); + // FIXME: Should be handled internally to bookletLayout. + promise.done( this.bookletLayout.focusPart.bind( this.bookletLayout, part.getId() ) ); } }; @@ -162,7 +163,7 @@ ve.ui.MWTransclusionDialog.prototype.addParameter = function () { // these magical "empty" constants. var placeholderParameter = new ve.dm.MWParameterModel( part ); part.addParameter( placeholderParameter ); - this.focusPart( placeholderParameter.getId() ); + this.bookletLayout.focusPart( placeholderParameter.getId() ); this.autoExpandSidebar(); }; @@ -373,7 +374,7 @@ ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar ) } else { selectedPage.scrollElementIntoView(); // TODO: Find a reliable way to refocus. - // dialog.focusPart( name ); + // dialog.bookletLayout.focusPart( name ); } }, OO.ui.theme.getDialogTransitionDuration() ); } @@ -428,7 +429,7 @@ ve.ui.MWTransclusionDialog.prototype.addPart = function ( part ) { // Add the part, and if dialog is loaded switch to part page var promise = this.transclusionModel.addPart( part, index ); if ( this.loaded && !this.preventReselection ) { - promise.done( this.focusPart.bind( this, part.getId() ) ); + promise.done( this.bookletLayout.focusPart.bind( this.bookletLayout, part.getId() ) ); } };