summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-09-22 09:40:29 +0200
committerAleš Smodiš <aless@guru.si>2015-09-22 09:40:29 +0200
commit9043754b69c64419c285a703daf203b87af70506 (patch)
treeb892f5c82d8bcedd6d4948850d9c70791333e085 /js
parent850f7a98c657f68b69c72cf7a369541cd3bbefc2 (diff)
Implement codeq.wait() that takes a promise and grays the screen until the promise is resolved.
Diffstat (limited to 'js')
-rw-r--r--js/codeq.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/codeq.js b/js/codeq.js
index 0ff78b2..702ccfa 100644
--- a/js/codeq.js
+++ b/js/codeq.js
@@ -736,4 +736,14 @@ window.phandler = null; // TODO: this is for debug only
return n;
};
+ var jqDisabled = $('#disabled'),
+ waitCssEnter = {'cursor': 'wait', 'display': ''};
+
+ codeq.wait = function (promise) {
+ jqDisabled.css(waitCssEnter);
+ return promise.fin(function () {
+ jqDisabled.css('display', 'none');
+ });
+ };
+
})();