Display notification when disabling input methods from keyboard icon menu
Bug: 48534 Change-Id: Id6c1cb22cb09a226cfcc84d597724e5d803392f3
This commit is contained in:
@@ -125,19 +125,20 @@
|
||||
} );
|
||||
|
||||
// Hide the menu.
|
||||
$moreSettingsLink.on( 'click', function (e) {
|
||||
imeselector.$menu.removeClass( 'open' );
|
||||
$moreSettingsLink.on( 'click', function ( e ) {
|
||||
imeselector.hide();
|
||||
e.stopPropagation();
|
||||
} );
|
||||
|
||||
$disableInputToolsLink.i18n();
|
||||
|
||||
$disableInputToolsLink.on( 'click', function (e) {
|
||||
$disableInputToolsLink.on( 'click', function ( e ) {
|
||||
$.ime.preferences.disable();
|
||||
imeselector.hide();
|
||||
imeselector.$menu.removeClass( 'open' );
|
||||
imeselector.$imeSetting.hide();
|
||||
$.ime.preferences.save( function () {
|
||||
mw.ime.disable();
|
||||
imeNotification();
|
||||
} );
|
||||
e.stopPropagation();
|
||||
} );
|
||||
@@ -200,5 +201,28 @@
|
||||
|
||||
} );
|
||||
|
||||
function imeNotification () {
|
||||
var notificationMsg = ( mw.config.get( 'wgULSPosition' ) === 'personal' ) ?
|
||||
'ext-uls-input-disable-notification-info-personal' :
|
||||
'ext-uls-input-disable-notification-info-interlanguage',
|
||||
$notification = $( '<div>' )
|
||||
.addClass( 'uls-ime-notification-bubble' )
|
||||
.append(
|
||||
$( '<div>' )
|
||||
.attr( 'data-i18n', 'ext-uls-input-disable-notification' ),
|
||||
$( '<div>' )
|
||||
.addClass( 'link' )
|
||||
.attr( 'data-i18n', 'ext-uls-input-disable-notification-undo' )
|
||||
.on( 'click', function() {
|
||||
$.ime.preferences.enable();
|
||||
$.ime.preferences.save( function () {
|
||||
mw.ime.setup();
|
||||
} );
|
||||
} ),
|
||||
$( '<div>' ).attr( 'data-i18n', notificationMsg )
|
||||
);
|
||||
|
||||
mw.notify( $notification.i18n() );
|
||||
}
|
||||
|
||||
}( jQuery, mediaWiki, document ) );
|
||||
|
||||
Reference in New Issue
Block a user