aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/search-query-parser.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2019-11-03 15:45:07 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2019-11-23 17:45:44 +0200
commitc78ca36f3dca8a3ca32923bd65e84a59d0f51613 (patch)
treea5f71ce50db74fba65ce94049aab989ad2409398 /ext/bg/js/search-query-parser.js
parent8825c481b5139ce41ad227da4d7e8725666aa072 (diff)
switch to mousemove events in query parser
Diffstat (limited to 'ext/bg/js/search-query-parser.js')
-rw-r--r--ext/bg/js/search-query-parser.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index dfab0d9a..cff48c46 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -36,7 +36,7 @@ class QueryParser {
this.onTermLookup(e, {disableScroll: true, selectText});
}
- onMouseEnter(e) {
+ onMouseMove(e) {
if (
this.pendingLookup ||
(e.buttons & 0x1) !== 0x0 // Left mouse button
@@ -112,11 +112,16 @@ class QueryParser {
}
activateScanning(element) {
- element.addEventListener('mouseenter', (e) => {
- e.target.dataset.timer = setTimeout(() => {
- this.onMouseEnter(e);
- delete e.target.dataset.timer;
- }, this.search.options.scanning.delay);
+ element.addEventListener('mousemove', (e) => {
+ clearTimeout(e.target.dataset.timer);
+ if (this.search.options.scanning.modifier === 'none') {
+ e.target.dataset.timer = setTimeout(() => {
+ this.onMouseMove(e);
+ delete e.target.dataset.timer;
+ }, this.search.options.scanning.delay);
+ } else {
+ this.onMouseMove(e);
+ }
});
element.addEventListener('mouseleave', (e) => {
clearTimeout(e.target.dataset.timer);