aboutsummaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-24 11:31:55 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-24 11:31:55 -0700
commitb421b435fad14f1cf4f644a8e64e1d2e5c6184cd (patch)
tree0d34c13b658f892c4314778510a6d78180e1a5ba /ext/fg
parent7f661fdd813ff1b792758f3e9450e99eae5b3827 (diff)
Fixing selection bug
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/client.js4
-rw-r--r--ext/fg/js/range.js1
2 files changed, 1 insertions, 4 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index bc389818..44a3b84c 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -118,10 +118,6 @@ class Client {
this.popup.showNextTo(range.getRect(), content);
if (this.options.highlightText) {
- if (this.lastRange !== null) {
- this.lastRange.deselect();
- }
-
range.select();
}
diff --git a/ext/fg/js/range.js b/ext/fg/js/range.js
index 9a98fb1a..1d6b4e0e 100644
--- a/ext/fg/js/range.js
+++ b/ext/fg/js/range.js
@@ -62,6 +62,7 @@ class Range {
select() {
const selection = window.getSelection();
+ selection.removeAllRanges();
selection.addRange(this.rng);
}