mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-17 19:11:06 +00:00
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:
parent
edad9c1f9a
commit
94a9b24567
1 changed files with 13 additions and 6 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue