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 9610f801bacaa5f29dd2f792bb289b073575241a 1 parent 4a28059
@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
@@ -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() {
Please sign in to comment.
Something went wrong with that request. Please try again.