summaryrefslogtreecommitdiff
path: root/js/reader_iframe.js
diff options
context:
space:
mode:
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();
});