diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-10-05 16:47:19 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-10-05 16:47:19 +0200 |
commit | 3d1f057373836092623766809bbe0551b56b50b6 (patch) | |
tree | fa6ccf99f6c7611e0b9ecbdf045a280f68795dd6 /theme/javascript/state.js | |
parent | 0679807517f2b53954b24434bbf7a847fe833c01 (diff) | |
download | gitbook-3d1f057373836092623766809bbe0551b56b50b6.zip gitbook-3d1f057373836092623766809bbe0551b56b50b6.tar.gz gitbook-3d1f057373836092623766809bbe0551b56b50b6.tar.bz2 |
Switch to gulp/browserify
Diffstat (limited to 'theme/javascript/state.js')
-rw-r--r-- | theme/javascript/state.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/theme/javascript/state.js b/theme/javascript/state.js new file mode 100644 index 0000000..52b9ab3 --- /dev/null +++ b/theme/javascript/state.js @@ -0,0 +1,16 @@ +var $ = require('jquery'); + +var state = {}; + +state.update = function(dom) { + var $book = $(dom.find(".book")); + + state.$book = $book; + state.level = $book.data("level"); + state.basePath = $book.data("basepath"); + state.revision = $book.data("revision"); +}; + +state.update($); + +module.exports = state; |