aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-07 22:41:16 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-07 22:41:16 -0700
commit5db0d5d59ac794430a886a41eeb4ba18a9ee635a (patch)
tree9e80073fd447cd57e766c81babcf0a83bcb9fbbf /ext/fg/js/client.js
parentedbb8086bc834b837268d10a54371a0247d99827 (diff)
WIP
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 56d43c3e..6b618bde 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -113,9 +113,11 @@ class Client {
}
showPopup(range) {
- const selection = window.getSelection();
- selection.removeAllRanges();
- selection.addRange(range);
+ if (this.options.highlightText) {
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
const pos = getPopupPositionForRange(this.popup, range, this.popupOffset);
@@ -130,8 +132,10 @@ class Client {
return;
}
- const selection = window.getSelection();
- selection.removeAllRanges();
+ if (this.options.highlightText) {
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ }
this.popupText = '';
this.popup.style.visibility = 'hidden';