-
-
Save olimortimer/3036332 to your computer and use it in GitHub Desktop.
JS: Block page whilst showing jQuery loading message
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
/* | |
The jQuery Mobile "loading" message allows users to click on UI items around it | |
Using Mike Alsup's BlockUI, we can stop this | |
http://jquery.malsup.com/block/#download | |
Thanks to MorningZ | |
https://gist.github.com/MorningZ | |
*/ | |
// 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