mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Focus the input after switching to the content pane"
This commit is contained in:
commit
9754f8fd8f
|
@ -371,6 +371,9 @@ ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar )
|
|||
dialog.sidebar.setSelectionByPageName( name );
|
||||
} else {
|
||||
selectedPage.scrollElementIntoView( { alignToTop: true, padding: { top: 20 } } );
|
||||
if ( !OO.ui.isMobile() ) {
|
||||
selectedPage.focus();
|
||||
}
|
||||
}
|
||||
}, OO.ui.theme.getDialogTransitionDuration() );
|
||||
}
|
||||
|
|
|
@ -133,8 +133,10 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.focus = function () {
|
|||
if ( !page ) {
|
||||
return;
|
||||
}
|
||||
// Only change the focus if is not already in the current page
|
||||
if ( !OO.ui.contains( page.$element[ 0 ], this.getElementDocument().activeElement, true ) ) {
|
||||
// Only change the focus if it's visible and is not already the current page
|
||||
if ( page.$element[ 0 ].offsetParent !== null &&
|
||||
!OO.ui.contains( page.$element[ 0 ], this.getElementDocument().activeElement, true )
|
||||
) {
|
||||
page.focus();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue