From 0745af1292dfa35e1744200283ba79c8e8162303 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Thu, 3 Feb 2011 17:49:58 -0500 Subject: [PATCH 1/2] typo in code example. Fixes #966 --- docs/forms/forms-selects.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/forms/forms-selects.html b/docs/forms/forms-selects.html index 2d93f3a3..7d7c57dc 100644 --- a/docs/forms/forms-selects.html +++ b/docs/forms/forms-selects.html @@ -125,7 +125,7 @@
 $(document).bind('mobileinit',function(){
-	$.mobile.selectmenu.prototype.options.nativemenu = true;
+	$.mobile.selectmenu.prototype.options.nativeMenu = true;
 });
 				
From 8dc5d0d79e0be7cdbafcb659ea49636341cede99 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Thu, 3 Feb 2011 18:28:32 -0500 Subject: [PATCH 2/2] fixed a regression in some android 2.2 devices where checkboxes were toggling on and off on every click. Fixes #935 as well. --- js/jquery.mobile.forms.checkboxradio.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index b7690974..d389ce16 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -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();