summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-07-02 15:32:55 +0300
committerAndrew Dolgov <[email protected]>2018-07-02 15:32:55 +0300
commit6a244552a58beafe64ab12142d5b98bec0c97c1b (patch)
tree1f216bda0270b97a9ad088728b9b9ec08331ec13 /read.html
parent62346ca9259cd2571b9dd4746341107d6409b35d (diff)
add toolbar button to jump back if following relative URL
Diffstat (limited to 'read.html')
-rw-r--r--read.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/read.html b/read.html
index c1983dd..ae1a008 100644
--- a/read.html
+++ b/read.html
@@ -191,6 +191,11 @@
</span>
<span class="toolbar">
+ <span class="prev_location_btn"
+ onclick="open_previous_location(this)" style="display : none">
+ <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
+ </span>
+
<span onclick="request_fullscreen()">
<span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
</span>
@@ -432,6 +437,21 @@
rendition.hooks.content.register(function(contents) {
+ contents.on("linkClicked", function(href) {
+ console.log('linkClicked', href);
+
+ if (href.indexOf("://") == -1) {
+ $(".prev_location_btn")
+ .attr("data-location-cfi", book.rendition.currentLocation().start.cfi)
+ .show();
+
+ window.setTimeout(function() {
+ show_ui(true);
+ }, 50);
+ }
+
+ });
+
var base_url = window.location.href.match(/^.*\//)[0];
var res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile.custom.js",
"js/reader.js", "js/dict.js" ];