Update jquery.ime from upstream
* Fixes bug 44992 * Improvements to click event handling Change-Id: I2146340051b937cb51e7f296fd947262c781d712
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*! jquery.ime - v0.1.0 - 2013-03-06
|
||||
/*! jquery.ime - v0.1.0 - 2013-03-11
|
||||
* https://github.com/wikimedia/jquery.ime
|
||||
* Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
|
||||
( function ( $ ) {
|
||||
@@ -536,8 +536,9 @@
|
||||
},
|
||||
|
||||
focus: function () {
|
||||
// Hide all other IME settings
|
||||
// Hide all other IME settings and collapse open menus
|
||||
$( 'div.imeselector' ).hide();
|
||||
$( 'div.imeselector-menu' ).removeClass( 'open' );
|
||||
this.$imeSetting.show();
|
||||
this.resetTimer();
|
||||
},
|
||||
@@ -555,16 +556,24 @@
|
||||
return false;
|
||||
},
|
||||
|
||||
toggle: function () {
|
||||
if ( this.$menu.hasClass( 'open' ) ) {
|
||||
this.hide();
|
||||
} else {
|
||||
this.show();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Bind the events and listen
|
||||
*/
|
||||
listen: function () {
|
||||
var imeselector = this;
|
||||
|
||||
$( 'html' ).on( 'click.ime', function () {
|
||||
imeselector.hide();
|
||||
if ( imeselector.$element.is( ':hidden' ) ) {
|
||||
imeselector.$imeSetting.hide();
|
||||
imeselector.$imeSetting.on( 'click.ime', function ( e ) {
|
||||
var t = $( e.target );
|
||||
if ( t.hasClass( 'imeselector-toggle' ) ) {
|
||||
imeselector.toggle();
|
||||
}
|
||||
} );
|
||||
|
||||
@@ -605,8 +614,6 @@
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
imeselector.$imeSetting.on( 'click.ime', $.proxy( this.show, this ) );
|
||||
|
||||
imeselector.$element.on( 'focus.ime', function ( e ) {
|
||||
imeselector.selectLanguage( imeselector.decideLanguage() );
|
||||
imeselector.focus();
|
||||
@@ -667,7 +674,7 @@
|
||||
- this.$imeSetting.outerWidth();
|
||||
room = $( window ).height() - top;
|
||||
if ( room < this.$imeSetting.outerHeight() ) {
|
||||
top = top - this.$imeSetting.outerHeight();
|
||||
top = position.top - this.$imeSetting.outerHeight();
|
||||
|
||||
this.$menu.css( 'top',
|
||||
- ( this.$menu.outerHeight() +
|
||||
@@ -927,9 +934,9 @@
|
||||
);
|
||||
}
|
||||
|
||||
var selectorTemplate = '<div class="imeselector">'
|
||||
var selectorTemplate = '<div class="imeselector imeselector-toggle">'
|
||||
+ '<a class="ime-name imeselector-toggle" href="#"></a>'
|
||||
+ '<b class="ime-setting-caret"></b></div>',
|
||||
+ '<b class="ime-setting-caret imeselector-toggle"></b></div>',
|
||||
|
||||
MutationObserver = window.MutationObserver || window.WebKitMutationObserver
|
||||
|| window.MozMutationObserver;
|
||||
|
||||
Reference in New Issue
Block a user