summaryrefslogtreecommitdiffstats
path: root/theme/javascript/loading.js
diff options
context:
space:
mode:
Diffstat (limited to 'theme/javascript/loading.js')
-rw-r--r--theme/javascript/loading.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/theme/javascript/loading.js b/theme/javascript/loading.js
new file mode 100644
index 0000000..797b487
--- /dev/null
+++ b/theme/javascript/loading.js
@@ -0,0 +1,14 @@
+var state = require('./state');
+
+function showLoading(p) {
+ state.$book.addClass('is-loading');
+ p.always(function() {
+ state.$book.removeClass('is-loading');
+ });
+
+ return p;
+}
+
+module.exports = {
+ show: showLoading
+};