Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…vent binding.
  • Loading branch information...
commit 29eaf47c79b2ae4426ff0d3cf3c193b63d835a36 1 parent 466cca6
@jaspermdegroot jaspermdegroot authored
Showing with 24 additions and 15 deletions.
  1. +24 −15 js/widgets/forms/select.js
View
39 js/widgets/forms/select.js
@@ -185,25 +185,34 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
});
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
- if ( self.options.preventFocusZoom ) {
- self.button.bind( "vmousedown", function() {
- $.mobile.zoom.disable( true );
- });
- self.label.bind( "click focus", function() {
- $.mobile.zoom.disable( true );
- });
- self.select.bind( "focus", function() {
- $.mobile.zoom.disable( true );
- });
- self.button.bind( "mouseup", function() {
+ self.button.bind( "vmousedown", function() {
+ if ( self.options.preventFocusZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ });
+ self.label.bind( "click focus", function() {
+ if ( self.options.preventFocusZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ });
+ self.select.bind( "focus", function() {
+ if ( self.options.preventFocusZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ });
+ self.button.bind( "mouseup", function() {
+ if ( self.options.preventFocusZoom ) {
setTimeout(function() {
$.mobile.zoom.enable( true );
}, 0 );
- });
- self.select.bind( "blur", function() {
+ }
+ });
+ self.select.bind( "blur", function() {
+ if ( self.options.preventFocusZoom ) {
$.mobile.zoom.enable( true );
- });
- }
+ }
+ });
+
},
selected: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.