Page scrolls when opening language selector
Was happening mostly on Firefox when ULS was in personal position and you were logged out and allowed to change language. Loading grid here already prevents graphical glitch and delaying the click seems to prevent scrolling to wrong position. Bug: 56937 Change-Id: Ie9acaa5a46fd903221d30c94dbc26a83355cdb64
This commit is contained in:
@@ -423,7 +423,7 @@
|
|||||||
mw.hook( 'mw.uls.settings.open' ).fire( eventParams && eventParams.source || 'personal' );
|
mw.hook( 'mw.uls.settings.open' ).fire( eventParams && eventParams.source || 'personal' );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mw.loader.using( 'ext.uls.mediawiki', function () {
|
mw.loader.using( ['ext.uls.mediawiki', 'jquery.uls.grid'], function () {
|
||||||
$ulsTrigger.uls( {
|
$ulsTrigger.uls( {
|
||||||
quickList: function () {
|
quickList: function () {
|
||||||
return mw.uls.getFrequentLanguageList();
|
return mw.uls.getFrequentLanguageList();
|
||||||
@@ -441,7 +441,13 @@
|
|||||||
onVisible: function () {
|
onVisible: function () {
|
||||||
mw.uls.addEventLoggingTriggers();
|
mw.uls.addEventLoggingTriggers();
|
||||||
}
|
}
|
||||||
} ).trigger( 'click', eventParams );
|
} );
|
||||||
|
|
||||||
|
// Allow styles to apply first and position to work by
|
||||||
|
// delaying the activation after them.
|
||||||
|
window.setTimeout( function () {
|
||||||
|
$ulsTrigger.trigger( 'click', eventParams );
|
||||||
|
}, 0 );
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
} );
|
} );
|
||||||
|
|||||||
Reference in New Issue
Block a user