Skip to content
This repository
Browse code

Selectmenu: the preventFocusZoom option check needs to be insde the e…

…vent binding.
  • Loading branch information...
commit 9610f801bacaa5f29dd2f792bb289b073575241a 1 parent 4a28059
Jasper de Groot authored November 29, 2012

Showing 1 changed file with 24 additions and 15 deletions. Show diff stats Hide diff stats

  1. 39  js/widgets/forms/select.js
39  js/widgets/forms/select.js
@@ -186,25 +186,34 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
186 186
 			});
187 187
 
188 188
 		// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
189  
-		if ( self.options.preventFocusZoom ) {
190  
-			self.button.bind( "vmousedown", function() {
191  
-				$.mobile.zoom.disable( true );
192  
-			});
193  
-			self.label.bind( "click focus", function() {
194  
-				$.mobile.zoom.disable( true );
195  
-			});
196  
-			self.select.bind( "focus", function() {
197  
-				$.mobile.zoom.disable( true );
198  
-			});
199  
-			self.button.bind( "mouseup", function() {
  189
+		self.button.bind( "vmousedown", function() {
  190
+			if ( self.options.preventFocusZoom ) {
  191
+					$.mobile.zoom.disable( true );
  192
+			}
  193
+		});
  194
+		self.label.bind( "click focus", function() {
  195
+			if ( self.options.preventFocusZoom ) {
  196
+					$.mobile.zoom.disable( true );
  197
+			}
  198
+		});
  199
+		self.select.bind( "focus", function() {
  200
+			if ( self.options.preventFocusZoom ) {
  201
+					$.mobile.zoom.disable( true );
  202
+			}
  203
+		});
  204
+		self.button.bind( "mouseup", function() {
  205
+			if ( self.options.preventFocusZoom ) {				
200 206
 				setTimeout(function() {
201 207
 					$.mobile.zoom.enable( true );
202 208
 				}, 0 );
203  
-			});
204  
-			self.select.bind( "blur", function() {
  209
+			}
  210
+		});
  211
+		self.select.bind( "blur", function() {
  212
+			if ( self.options.preventFocusZoom ) {				
205 213
 				$.mobile.zoom.enable( true );
206  
-			});
207  
-		}
  214
+			}
  215
+		});
  216
+
208 217
 	},
209 218
 
210 219
 	selected: function() {

0 notes on commit 9610f80

Please sign in to comment.
Something went wrong with that request. Please try again.