mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
fixed a regression in some android 2.2 devices where checkboxes were toggling on and off on every click. Fixes #935 as well.
This commit is contained in:
parent
0745af1292
commit
8dc5d0d79e
1 changed files with 23 additions and 1 deletions
|
|
@ -41,7 +41,29 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
if( $(this).parent().is('.ui-disabled') ){ return false; }
|
||||
},
|
||||
|
||||
"tap": function( event ){
|
||||
"touchmove": function( event ){
|
||||
var oe = event.originalEvent.touches[0];
|
||||
if( label.data("movestart") ){
|
||||
if( Math.abs( label.data("movestart")[0] - oe.pageX ) > 10 ||
|
||||
Math.abs( abel.data("movestart")[1] - oe.pageY ) > 10 ){
|
||||
label.data("moved", true);
|
||||
}
|
||||
}
|
||||
else{
|
||||
label.data("movestart", [ parseFloat( oe.pageX ), parseFloat( oe.pageY ) ]);
|
||||
}
|
||||
},
|
||||
|
||||
"touchend mouseup": function( event ){
|
||||
label.removeData("movestart");
|
||||
if( label.data("etype") && label.data("etype") !== event.type || label.data("moved") ){
|
||||
label.removeData("etype").removeData("moved");
|
||||
if( label.data("moved") ){
|
||||
label.removeData("moved");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
label.data( "etype", event.type );
|
||||
self._cacheVals();
|
||||
input.attr( "checked", inputtype === "radio" && true || !input.is( ":checked" ) );
|
||||
self._updateAll();
|
||||
|
|
|
|||
Loading…
Reference in a new issue