added the locked property, with options to lock and unlock it when calling disable or enable, respectively. This allows a plugin to take control and ensure zoom isn't messed with while it's carrying out a zoom-specific task

This commit is contained in:
scottjehl 2012-01-24 17:23:36 +07:00
parent edad9c1f9a
commit 94a9b24567

View file

@ -12,13 +12,20 @@ define( [ "jquery", "jquery.mobile.core" ], function( $ ) {
$.mobile.zoom = $.extend( {}, {
enabled: true,
disable: function() {
meta.attr( "content", disabledZoom );
$.mobile.zoom.enabled = false;
locked: false,
disable: function( lock ) {
if( !$.mobile.zoom.locked ){
meta.attr( "content", disabledZoom );
$.mobile.zoom.enabled = false;
$.mobile.zoom.locked = lock || false;
}
},
enable: function() {
meta.attr( "content", enabledZoom );
$.mobile.zoom.enabled = true;
enable: function( unlock ) {
if( !$.mobile.zoom.locked || unlock ){
meta.attr( "content", enabledZoom );
$.mobile.zoom.enabled = true;
$.mobile.zoom.locked = false;
}
},
restore: function() {
meta.attr( "content", initialContent );