Fix: ULS popup moves to sidebar if opened from ime menu
Issues fixed: Incorrect position of ULS when accessed from more languages button of input/display settings, when language settings opened from ime menu. Arrow(callout) appearing for ULS when opened from more languages button of input/display settings, when language settings opened from ime menu. Used a class 'callout' to mark whether windows need callout arrow or not. Bug: 49060 Change-Id: Ic4c0a1e386918494a0d006a02dd0cf93ef269163
This commit is contained in:
committed by
Gerrit Code Review
parent
6a9b31ad26
commit
e9ab300889
@@ -330,8 +330,17 @@
|
||||
uls.$menu.find( 'h1.uls-title' )
|
||||
.data( 'i18n', 'ext-uls-input-settings-ui-language' )
|
||||
.i18n();
|
||||
uls.$menu.prepend(
|
||||
$( '<span>' ).addClass( 'caret-before' ),
|
||||
$( '<span>' ).addClass( 'caret-after' )
|
||||
);
|
||||
},
|
||||
onVisible: function () {
|
||||
if ( !inputSettings.$parent.$window.hasClass( 'callout' ) ) {
|
||||
// callout menus will have position rules. others use
|
||||
// default position
|
||||
return;
|
||||
}
|
||||
var $parent = $( '#language-settings-dialog' );
|
||||
// Re-position the element according to the window that called it
|
||||
if ( parseInt( $parent.css( 'left' ), 10 ) ) {
|
||||
@@ -340,6 +349,12 @@
|
||||
if ( parseInt( $parent.css( 'top' ), 10 ) ) {
|
||||
this.$menu.css( 'top', $parent.css( 'top' ) );
|
||||
}
|
||||
|
||||
if ( inputSettings.$parent.$window.hasClass( 'callout' ) ) {
|
||||
this.$menu.addClass( 'callout' );
|
||||
} else {
|
||||
this.$menu.removeClass( 'callout' );
|
||||
}
|
||||
},
|
||||
onSelect: function ( langCode ) {
|
||||
inputSettings.enableApplyButton();
|
||||
@@ -351,13 +366,6 @@
|
||||
lazyload: false
|
||||
} );
|
||||
|
||||
if ( mw.config.get( 'wgULSPosition' ) === 'interlanguage' ) {
|
||||
$moreLanguagesButton.data( 'uls' ).$menu.prepend(
|
||||
$( '<span>' ).addClass( 'caret-before' ),
|
||||
$( '<span>' ).addClass( 'caret-after' )
|
||||
);
|
||||
}
|
||||
|
||||
$moreLanguagesButton.on( 'click', function () {
|
||||
inputSettings.$parent.hide();
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user