summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core/state.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-14 23:00:40 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-14 23:00:40 +0200
commit93042893157b78b268a9ab4078cde31f4d78e6f5 (patch)
tree9ec7c968d8c344fb04363468b21d53fbbd08c283 /theme/javascript/core/state.js
parent1b726ca29398ae784e9592e31f40da49dbc7e570 (diff)
downloadgitbook-93042893157b78b268a9ab4078cde31f4d78e6f5.zip
gitbook-93042893157b78b268a9ab4078cde31f4d78e6f5.tar.gz
gitbook-93042893157b78b268a9ab4078cde31f4d78e6f5.tar.bz2
Fix progress display when page change
Diffstat (limited to 'theme/javascript/core/state.js')
-rwxr-xr-xtheme/javascript/core/state.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/theme/javascript/core/state.js b/theme/javascript/core/state.js
index 34851c1..2f7c633 100755
--- a/theme/javascript/core/state.js
+++ b/theme/javascript/core/state.js
@@ -1,14 +1,19 @@
define([
"jQuery"
], function() {
- var $book = $(".book");
+ var state = {};
- return {
- '$book': $book,
+ state.update = function(dom) {
+ var $book = $(dom.find(".book"));
- 'githubId': $book.data("github"),
- 'level': $book.data("level"),
- 'basePath': $book.data("basepath"),
- 'revision': $book.data("revision")
+ state.$book = $book;
+ state.githubId = $book.data("github");
+ state.level = $book.data("level");
+ state.basePath = $book.data("basepath");
+ state.revision = $book.data("revision");
};
+
+ state.update($);
+
+ return state;
}); \ No newline at end of file