Created
July 22, 2011 21:10
-
-
Save MorningZ/1100435 to your computer and use it in GitHub Desktop.
Over riding jQuery Mobile's stock "loading" modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I was struggling with the fact that the "stock" jQuery Mobile "loading" message | |
allowed users to click on UI items around it... | |
so it's Mike Alsup's BlockUI to the rescue! | |
first include his blockui library from: | |
http://jquery.malsup.com/block/#download | |
*/ | |
// Add this right before the closing <body> tag | |
(function () { | |
var originalHideMethod = $.mobile.hidePageLoadingMsg; | |
$.mobile.hidePageLoadingMsg = function () { | |
$("body").unblock(); | |
originalHideMethod.apply(this, arguments); | |
}; | |
var originalShowMethod = $.mobile.showPageLoadingMsg; | |
$.mobile.showPageLoadingMsg = function () { | |
$("body").block({ "message": null }); | |
originalShowMethod.apply(this, arguments); | |
}; | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This problem is sovled in jquery-archive/jquery-mobile#3414, in my project, I do like this: