Update jquery.ime to 806deb2
Changes: * README update to point about writing tests for IMEs. * Take scrollTop/scrollLeft into account when positioning. Change-Id: Ie39fb3f7f9f944e0186b74a51812e4d424174051
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/*! jquery.ime - v0.1.0+20141028
|
/*! jquery.ime - v0.1.0+20141229
|
||||||
* https://github.com/wikimedia/jquery.ime
|
* https://github.com/wikimedia/jquery.ime
|
||||||
* Copyright (c) 2014 Santhosh Thottingal; Licensed GPL, MIT */
|
* Copyright (c) 2014 Santhosh Thottingal; Licensed GPL, MIT */
|
||||||
( function ( $ ) {
|
( function ( $ ) {
|
||||||
@@ -1026,7 +1026,7 @@
|
|||||||
*/
|
*/
|
||||||
position: function () {
|
position: function () {
|
||||||
var menuWidth, menuTop, menuLeft, elementPosition,
|
var menuWidth, menuTop, menuLeft, elementPosition,
|
||||||
top, left, verticalRoom, overflowsOnRight,
|
top, left, cssTop, cssLeft, verticalRoom, overflowsOnRight,
|
||||||
imeSelector = this,
|
imeSelector = this,
|
||||||
rtlElement = this.$element.css( 'direction' ) === 'rtl',
|
rtlElement = this.$element.css( 'direction' ) === 'rtl',
|
||||||
$window = $( window );
|
$window = $( window );
|
||||||
@@ -1062,21 +1062,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cssTop = top;
|
||||||
|
cssLeft = left;
|
||||||
this.$element.parents().each( function() {
|
this.$element.parents().each( function() {
|
||||||
if ( $( this ).css( 'position' ) === 'fixed' ) {
|
if ( $( this ).css( 'position' ) === 'fixed' ) {
|
||||||
imeSelector.$imeSetting.css( 'position', 'fixed' );
|
imeSelector.$imeSetting.css( 'position', 'fixed' );
|
||||||
|
cssTop -= $( document ).scrollTop();
|
||||||
|
cssLeft -= $( document ).scrollLeft();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
this.$imeSetting.css( {
|
this.$imeSetting.css( {
|
||||||
top: top,
|
top: cssTop,
|
||||||
left: left
|
left: cssLeft
|
||||||
} );
|
} );
|
||||||
|
|
||||||
menuWidth = this.$menu.width();
|
menuWidth = this.$menu.width();
|
||||||
overflowsOnRight = ( left + menuWidth ) > $window.width();
|
overflowsOnRight = ( left - $( document ).scrollLeft() + menuWidth ) > $window.width();
|
||||||
|
|
||||||
// Adjust horizontal position if there's
|
// Adjust horizontal position if there's
|
||||||
// not enough space on any side
|
// not enough space on any side
|
||||||
|
|||||||
@@ -105,3 +105,4 @@ Examples
|
|||||||
|
|
||||||
For complete examples, please refer the existing input method definitions.
|
For complete examples, please refer the existing input method definitions.
|
||||||
|
|
||||||
|
Documentation of input methods are available at https://www.mediawiki.org/wiki/Help:Extension:UniversalLanguageSelector/Input_methods
|
||||||
|
|||||||
Reference in New Issue
Block a user