Fixes for focusPart

We missed some usages.  Follows up on I5f05bc119dc213d8

Change-Id: Iaecb804300c37d43108a14e8db0068deb58f503c
This commit is contained in:
Adam Wight 2022-06-28 15:31:54 +02:00
parent c29690b1f1
commit d138cd04bf

View file

@ -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() ) );
}
};