summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-25 20:11:44 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-28 17:03:42 -0400
commitbcffe80a1e8342da1bdcca3ee08f0d005a01a2c3 (patch)
tree4ab7c76b12cedc7467947979c71f470688966d75 /ext
parent6d85dae68d9820265887405666163eb19219c477 (diff)
Group similar functions together
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/frontend.js50
1 files changed, 25 insertions, 25 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index a963bd92..94c318d7 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -129,28 +129,22 @@ class Frontend {
this.popupTimerClear();
}
- onWindowMessage(e) {
- const action = e.data;
- const handlers = Frontend.windowMessageHandlers;
- if (handlers.hasOwnProperty(action)) {
- const handler = handlers[action];
- handler(this);
+ onClick(e) {
+ if (this.preventNextClick) {
+ this.preventNextClick = false;
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
}
}
- async onResize() {
- if (this.textSourceCurrent !== null && await this.popup.isVisibleAsync()) {
- const textSource = this.textSourceCurrent;
- this.lastShowPromise = this.popup.showContent(
- textSource.getRect(),
- textSource.getWritingMode()
- );
- }
+ onAuxClick(e) {
+ this.preventNextContextMenu = false;
}
- onClick(e) {
- if (this.preventNextClick) {
- this.preventNextClick = false;
+ onContextMenu(e) {
+ if (this.preventNextContextMenu) {
+ this.preventNextContextMenu = false;
e.preventDefault();
e.stopPropagation();
return false;
@@ -233,16 +227,22 @@ class Frontend {
e.preventDefault(); // Disable scroll
}
- onAuxClick(e) {
- this.preventNextContextMenu = false;
+ async onResize() {
+ if (this.textSourceCurrent !== null && await this.popup.isVisibleAsync()) {
+ const textSource = this.textSourceCurrent;
+ this.lastShowPromise = this.popup.showContent(
+ textSource.getRect(),
+ textSource.getWritingMode()
+ );
+ }
}
- onContextMenu(e) {
- if (this.preventNextContextMenu) {
- this.preventNextContextMenu = false;
- e.preventDefault();
- e.stopPropagation();
- return false;
+ onWindowMessage(e) {
+ const action = e.data;
+ const handlers = Frontend.windowMessageHandlers;
+ if (handlers.hasOwnProperty(action)) {
+ const handler = handlers[action];
+ handler(this);
}
}