Remove unused resetScroll function

Also removes some logic that could only be reached when
`this.scrolling` is true.

Bug: T310866
Change-Id: Id60cfd9d72fd0e38872f58386ea0f0b64a268214
This commit is contained in:
Adam Wight 2022-06-27 13:44:00 +02:00 committed by Awight
parent b1a12aeaab
commit bbe0356f43

View file

@ -129,15 +129,9 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onStackLayoutSet = function (
return;
}
// Scroll the selected page into view first
if ( !this.scrolling ) {
promise = page.scrollElementIntoView();
} else {
// eslint-disable-next-line no-jquery/no-deferred
promise = $.Deferred().resolve();
}
promise = page.scrollElementIntoView();
// Focus the first element on the newly selected panel.
// Don't focus if the page was set by scrolling.
if ( this.autoFocus && !OO.ui.isMobile() && !this.scrolling ) {
if ( this.autoFocus && !OO.ui.isMobile() ) {
promise.done( function () {
layout.focus();
} );
@ -459,26 +453,6 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.setPage = function ( name ) {
this.emit( 'set', page );
};
/**
* For outlined booklets, also reset the outlineSelectWidget to the first item.
*
* @inheritdoc
*/
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.resetScroll = function () {
// Parent method
ve.ui.MWTwoPaneTransclusionDialogLayout.super.prototype.resetScroll.call( this );
if (
this.outlined &&
this.outlineSelectWidget.findFirstSelectableItem()
) {
this.scrolling = true;
this.outlineSelectWidget.selectItem( this.outlineSelectWidget.findFirstSelectableItem() );
this.scrolling = false;
}
return this;
};
/**
* Select the first selectable page.
*