diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-04-07 22:41:16 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-04-07 22:41:16 -0700 |
commit | 5db0d5d59ac794430a886a41eeb4ba18a9ee635a (patch) | |
tree | 9e80073fd447cd57e766c81babcf0a83bcb9fbbf /ext/fg/js | |
parent | edbb8086bc834b837268d10a54371a0247d99827 (diff) |
WIP
Diffstat (limited to 'ext/fg/js')
-rw-r--r-- | ext/fg/js/client.js | 14 |
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'; |