summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-06-09 13:53:51 +0300
committerAndrew Dolgov <[email protected]>2017-06-09 13:53:51 +0300
commit4fe174cd142731f3131a05b1753cf3a0fcae0340 (patch)
treedf9be36208e07a3190685065ea74d6c8bc1f5e2d
parent36075d3f6a1c5785f8ffe959b2a86421f3673d24 (diff)
display current chapter while reading
-rw-r--r--read.html13
1 files changed, 10 insertions, 3 deletions
diff --git a/read.html b/read.html
index 10850fe..f1b6827 100644
--- a/read.html
+++ b/read.html
@@ -200,7 +200,7 @@
</div>
<div class="footer">
- <div class="notice bg-warning text-warning" style="display : none"></div>
+ <div class="chapter"></div>
<div class="location">
Loc: <span id="cur_page">?</span> / <span id="total_pages">?</span>
(<span id="page_pct">?</span>)
@@ -491,12 +491,19 @@
})
book.on("renderer:chapterUnloaded", function() {
- $(".notice").html("Loading...").show();
+ $(".chapter").html("Loading...");
});
book.on("renderer:chapterDisplayed", function() {
- $(".notice").hide();
+ $(".chapter").html("");
+
+ var toc_entry = book.toc.filter(function(a)
+ { if (a.href == book.currentChapter.href) return a })[0];
+
+ console.log(toc_entry);
+
+ if (toc_entry) $(".chapter").html(toc_entry.label);
});
book.on("renderer:chapterDisplayed", function() {