diff options
author | Andrew Dolgov <[email protected]> | 2018-07-02 15:32:55 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-07-02 15:32:55 +0300 |
commit | 6a244552a58beafe64ab12142d5b98bec0c97c1b (patch) | |
tree | 1f216bda0270b97a9ad088728b9b9ec08331ec13 /read.html | |
parent | 62346ca9259cd2571b9dd4746341107d6409b35d (diff) |
add toolbar button to jump back if following relative URL
Diffstat (limited to 'read.html')
-rw-r--r-- | read.html | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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" ]; |