mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
ve.ui.MWTemplateDialog: Prevent scrolling to top after removing a parameter
Bug: T180151 Change-Id: I063c53fa572e998f5b34fc895d02fe1a74026c6e
This commit is contained in:
parent
bbc55bcdba
commit
b51707d96f
|
@ -235,12 +235,15 @@ ve.ui.MWTemplateDialog.prototype.onRemoveParameter = function ( param ) {
|
|||
var page = this.bookletLayout.getPage( param.getId() ),
|
||||
reselect = this.bookletLayout.findClosestPage( page );
|
||||
|
||||
this.bookletLayout.removePages( [ page ] );
|
||||
if ( this.loaded ) {
|
||||
if ( !this.preventReselection ) {
|
||||
this.setPageByName( reselect.getName() );
|
||||
}
|
||||
// Select the desired page first. Otherwise, if the page we are removing is selected,
|
||||
// OOUI will try to select the first page after it is removed, and scroll to the top.
|
||||
if ( this.loaded && !this.preventReselection ) {
|
||||
this.setPageByName( reselect.getName() );
|
||||
}
|
||||
|
||||
this.bookletLayout.removePages( [ page ] );
|
||||
|
||||
if ( this.loaded ) {
|
||||
this.altered = true;
|
||||
this.setApplicableStatus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue