diff options
author | Andrew Dolgov <[email protected]> | 2020-11-20 12:00:12 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-11-20 12:00:12 +0300 |
commit | 48d990cdbf05e0e463e08ef69319bebcfdbbf4d8 (patch) | |
tree | 488bca5e01bbc2b686ff94a46941056a91efd86d /dist | |
parent | 521a040b7a460688675f1d5c0eac46bfe1a24883 (diff) |
better handling for selection dialog popup; disable double tap to fullscreen
Diffstat (limited to 'dist')
-rw-r--r-- | dist/reader_iframe.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dist/reader_iframe.min.js b/dist/reader_iframe.min.js index 4edac94..ed3107a 100644 --- a/dist/reader_iframe.min.js +++ b/dist/reader_iframe.min.js @@ -1 +1 @@ -"use strict";let Reader;function enable_swipes(){$(window).off("swipeleft swiperight"),$(window).on("swipeleft",(function(){Reader.Page.next()})),$(window).on("swiperight",(function(){Reader.Page.prev()}))}$(document).ready((function(){Reader=parent.__get_reader(),$(window).on("doubletap",(function(){getSelection().toString().trim().match(/^$/)&&Reader.toggleFullscreen()})),$(window).on("click tap",(function(e){if(0==e.button){if($(".modal").is(":visible"))return;"undefined"!=typeof EpubeApp?EpubeApp.toggleActionBar():Reader.showUI(!0)}})),$(window).on("touchstart",(function(){enable_swipes()})),$(window).on("mousedown",(function(){$(window).off("swipeleft swiperight")})),$(window).on("wheel",(function(e){e.originalEvent.deltaY>0?Reader.Page.next():e.originalEvent.deltaY<0&&Reader.Page.prev()})),$(window).on("mouseup touchend",(function(){if(!navigator.onLine)return;const e=getSelection().toString().trim();e.match(/^[\w]+$/)&&Reader.lookupWord(e,(function(){"undefined"!=typeof EpubeApp&&EpubeApp.showActionBar(!1),getSelection().removeAllRanges()}))})),enable_swipes()}));
\ No newline at end of file +"use strict";let Reader;function enable_swipes(){$(window).off("swipeleft swiperight"),$(window).on("swipeleft",(function(){Reader.Page.next()})),$(window).on("swiperight",(function(){Reader.Page.prev()}))}$(document).ready((function(){Reader=parent.__get_reader(),$(window).on("click tap",(function(e){if(0==e.button){if($(".modal").is(":visible"))return;"undefined"!=typeof EpubeApp?EpubeApp.toggleActionBar():Reader.showUI(!0)}})),$(window).on("touchstart",(function(){enable_swipes()})),$(window).on("mousedown",(function(){$(window).off("swipeleft swiperight")})),$(window).on("wheel",(function(e){e.originalEvent.deltaY>0?Reader.Page.next():e.originalEvent.deltaY<0&&Reader.Page.prev()}));let e=null;$(document).on("selectionchange",(function(){navigator.onLine&&(window.clearTimeout(e),e=window.setTimeout((function(){const e=getSelection().toString().trim();e.match(/^[\w]+$/)&&Reader.lookupWord(e,(function(){"undefined"!=typeof EpubeApp&&EpubeApp.showActionBar(!1),getSelection().removeAllRanges()}))}),250))})),enable_swipes()}));
\ No newline at end of file |