When running through some operations it may be beneficial to block the UI, and while processing update the blocked UI message every so often with a new message.
The most apparent way to do this is simply call blockUI again and specify a different message, but when this is done the UI momentarily unblocks and then the new block with the new message animates in and re-blocks the UI. This is not ideal for instances when you’d want to keep the UI blocked, but just update the message.
Here’s a way to update the message without momentarily unblocking the UI:
It’s a function called in the same way as you would call $.blockUI except if the UI is already blocked instead of blocking it again it will just update the block with the specified message.
example usage:
skuid.custom.blockUI({message: 'New or updated block message'});
// skuid.custom.blockUI(obj)<br>// blocks the UI with specified object as parameters to the blockUI function<br>// if the UI is already blocked, will instead update the existing block's message with obj.message<br>// rather than momentarily removing the block and replacing it with a new block<br>// as the standard blockUI function would do<br>skuid.custom.blockUI = function (obj) {<br> if ($('.blockUI.blockMsg.blockPage') !== undefined && $('.blockUI.blockMsg.blockPage')P0] !== undefined && obj !== undefined && obj.message !== undefined) {<br> $('.blockUI.blockMsg.blockPage')P0].textContent = obj.message;<br> } else {<br> $.blockUI(obj);<br> }
};