summaryrefslogtreecommitdiff
path: root/js/reader_iframe.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-10-08 16:05:18 +0300
committerAndrew Dolgov <[email protected]>2020-10-08 16:05:18 +0300
commitcf1d643376d4f18cd5cfa9075a21b11fb5713daf (patch)
tree15eedecef0f052368709dc74c5ee4c5eb41d9664 /js/reader_iframe.js
parent0add899fa4e15e1f0a872f03805a63886e999ca7 (diff)
some more gulp-related stuff
Diffstat (limited to 'js/reader_iframe.js')
-rw-r--r--js/reader_iframe.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/reader_iframe.js b/js/reader_iframe.js
index ceef058..897be44 100644
--- a/js/reader_iframe.js
+++ b/js/reader_iframe.js
@@ -56,6 +56,21 @@ $(document).ready(function() {
}
});
+ $(window).on("mouseup touchend", function() {
+ if (!navigator.onLine) return;
+
+ const sel = getSelection().toString().trim();
+
+ if (sel.match(/^[\w­]+$/)) {
+ Reader.lookupWord(sel, function() {
+ if (typeof EpubeApp != "undefined")
+ EpubeApp.showActionBar(false);
+
+ getSelection().removeAllRanges();
+ });
+ }
+ });
+
enable_swipes();
});