mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Only move content pane element to top when sidebar element is clicked
This patch contains a small cleanup that moves the scrollIntoView into onSidebarItemSelected. Since all other places already have a focus call, scrollIntoView is not needed there. Bug: T312850 Change-Id: I1a3cb3905faea2bd8a6bf8dc4cfd748813e1c875
This commit is contained in:
parent
fc70c924e5
commit
36d817dfcd
|
@ -157,6 +157,11 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.onSidebarItemSelected = functi
|
|||
if ( !soft ) {
|
||||
this.focus();
|
||||
}
|
||||
|
||||
var page = this.pages[ pageName ];
|
||||
if ( page ) {
|
||||
page.scrollElementIntoView( { alignToTop: true, padding: { top: 20 } } );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -345,12 +350,8 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.clearPages = function () {
|
|||
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.setPage = function ( name ) {
|
||||
var page = this.pages[ name ];
|
||||
|
||||
if ( page ) {
|
||||
page.scrollElementIntoView( { alignToTop: true, padding: { top: 20 } } );
|
||||
|
||||
if ( name === this.currentPageName ) {
|
||||
return;
|
||||
}
|
||||
if ( page && name === this.currentPageName ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var previousPage = this.currentPageName ? this.pages[ this.currentPageName ] : null;
|
||||
|
|
Loading…
Reference in a new issue