diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-27 18:05:13 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-27 18:05:13 +0200 |
commit | 54f530c7c36105698958908272e79935a56bf25f (patch) | |
tree | 7d01ad53a8013595461e5128b4b5140317df0f3e /theme/javascript/core/loading.js | |
parent | ca94055adf2d0519105b587116d5d56b559a2c3a (diff) | |
parent | 9fdc5da22da283f8c3a76760194bf2f61a8cebd4 (diff) | |
download | gitbook-54f530c7c36105698958908272e79935a56bf25f.zip gitbook-54f530c7c36105698958908272e79935a56bf25f.tar.gz gitbook-54f530c7c36105698958908272e79935a56bf25f.tar.bz2 |
Merge pull request #171 from GitbookIO/feature/offlineCache
Improve pages loading
Diffstat (limited to 'theme/javascript/core/loading.js')
-rw-r--r-- | theme/javascript/core/loading.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/theme/javascript/core/loading.js b/theme/javascript/core/loading.js new file mode 100644 index 0000000..193531f --- /dev/null +++ b/theme/javascript/core/loading.js @@ -0,0 +1,18 @@ +define([ + "jQuery" +], function($) { + var showLoading = function(p) { + var $book = $(".book"); + + $book.addClass("is-loading"); + p.always(function() { + $book.removeClass("is-loading"); + }); + + return p; + }; + + return { + show: showLoading + }; +});
\ No newline at end of file |