diff options
author | Andrew Dolgov <[email protected]> | 2017-06-09 13:53:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-06-09 13:53:51 +0300 |
commit | 4fe174cd142731f3131a05b1753cf3a0fcae0340 (patch) | |
tree | df9be36208e07a3190685065ea74d6c8bc1f5e2d | |
parent | 36075d3f6a1c5785f8ffe959b2a86421f3673d24 (diff) |
display current chapter while reading
-rw-r--r-- | read.html | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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() { |