Update jquery.ime from upstream
- Namespaces for events Change-Id: Ife372ec4fc3b9610c6a04ce5a94aa2b83b9c933e
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
constructor: IME,
|
||||
|
||||
listen: function () {
|
||||
this.$element.on( 'keypress', $.proxy( this.keypress, this ) );
|
||||
this.$element.on( 'keypress.ime', $.proxy( this.keypress, this ) );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -839,35 +839,35 @@
|
||||
listen: function () {
|
||||
var imeselector = this;
|
||||
|
||||
$( 'html' ).on( 'click', function () {
|
||||
$( 'html' ).on( 'click.ime', function () {
|
||||
imeselector.$menu.removeClass( 'open' );
|
||||
} );
|
||||
|
||||
imeselector.$menu.on( 'click', 'li.ime-im', function ( e ) {
|
||||
imeselector.$menu.on( 'click.ime', 'li.ime-im', function ( e ) {
|
||||
imeselector.selectIM( $( this ).data( 'ime-inputmethod' ) );
|
||||
e.stopPropagation();
|
||||
} );
|
||||
|
||||
imeselector.$menu.on( 'click', 'li.ime-lang', function ( e ) {
|
||||
imeselector.$menu.on( 'click.ime', 'li.ime-lang', function ( e ) {
|
||||
imeselector.selectLanguage( $( this ).attr( 'lang' ) );
|
||||
e.stopPropagation();
|
||||
} );
|
||||
|
||||
imeselector.$menu.on( 'click', 'li.ime-disable-link', function ( e ) {
|
||||
imeselector.$menu.on( 'click.ime', 'li.ime-disable-link', function ( e ) {
|
||||
imeselector.disableIM();
|
||||
e.stopPropagation();
|
||||
} );
|
||||
|
||||
imeselector.$element.on( 'focus', function() {
|
||||
imeselector.$element.on( 'focus.ime', function() {
|
||||
imeselector.selectLanguage( $.ime.preferences.getLanguage() );
|
||||
imeselector.focus( );
|
||||
} );
|
||||
|
||||
// Possible resize of textarea
|
||||
imeselector.$element.on( 'mouseup', $.proxy( this.position, this ) );
|
||||
imeselector.$element.on( 'keydown', $.proxy( this.keydown, this ) );
|
||||
imeselector.$element.on( 'mouseup.ime', $.proxy( this.position, this ) );
|
||||
imeselector.$element.on( 'keydown.ime', $.proxy( this.keydown, this ) );
|
||||
|
||||
imeselector.$imeSetting.on( 'click', $.proxy( this.toggle, this ) );
|
||||
imeselector.$imeSetting.on( 'click.ime', $.proxy( this.toggle, this ) );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -916,10 +916,17 @@
|
||||
* @param languageCode
|
||||
*/
|
||||
selectLanguage: function ( languageCode ) {
|
||||
var language;
|
||||
|
||||
language = $.ime.languages[languageCode];
|
||||
|
||||
if ( !language ) {
|
||||
return false;
|
||||
}
|
||||
this.$menu.find( 'li.ime-lang' ).show();
|
||||
this.$menu.find( 'li[lang=' + languageCode + ']' ).hide();
|
||||
|
||||
this.$menu.find( 'li.ime-list-title' ).text( $.ime.languages[languageCode].autonym );
|
||||
this.$menu.find( 'li.ime-list-title' ).text( language.autonym );
|
||||
this.prepareInputMethods( languageCode );
|
||||
this.$menu.removeClass( 'open' );
|
||||
// And select the default inputmethod
|
||||
@@ -1178,4 +1185,4 @@
|
||||
// load registry from cookies or localstorage
|
||||
}
|
||||
} );
|
||||
}( jQuery ) );
|
||||
}( jQuery ) );
|
||||
Reference in New Issue
Block a user