mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
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:
parent
b1a12aeaab
commit
bbe0356f43
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue