summaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-10 14:00:44 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-10 14:00:44 -0500
commitd9b44040751846d6b0bbf5fcf6ea4152f6ce9bcc (patch)
treeb1dabd9ff08a29dac69e0b15d63421d977fda28e /ext/mixed/js/display.js
parentdad685dba42961697c78a26078c0d5a2e0750e8c (diff)
Create functions for the cases of isMouseButton
jshint was showing a warning that there was no break statement after the first case, which there doesn't need to be. The most straightforward way to fix this without using the unclear // jshint ignore:line is to just have two functions. This change also updates invocations of isMouseButton to use the exact case function, as this will remove the need to check the case of mosueEvent.type. This was done because onMouseMove is invoked at a high frequency.
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 5a824561..801011df 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -83,7 +83,7 @@ class Display {
}
onGlossaryMouseDown(e) {
- if (Frontend.isMouseButton('primary', e)) {
+ if (Frontend.isMouseButtonPressed('primary', e)) {
this.clickScanPrevent = false;
}
}
@@ -93,7 +93,7 @@ class Display {
}
onGlossaryMouseUp(e) {
- if (!this.clickScanPrevent && Frontend.isMouseButton('primary', e)) {
+ if (!this.clickScanPrevent && Frontend.isMouseButtonPressed('primary', e)) {
this.onTermLookup(e);
}
}