Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Selectmenu: the preventFocusZoom option check needs to be insde the e…
Browse files Browse the repository at this point in the history
…vent binding.
  • Loading branch information
jaspermdegroot committed Nov 29, 2012
1 parent 4a28059 commit 9610f80
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions js/widgets/forms/select.js
Expand Up @@ -186,25 +186,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() {
Expand Down

0 comments on commit 9610f80

Please sign in to comment.