From bcffe80a1e8342da1bdcca3ee08f0d005a01a2c3 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 25 Oct 2019 20:11:44 -0400 Subject: [PATCH] Group similar functions together --- ext/fg/js/frontend.js | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 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,25 +129,6 @@ class Frontend { this.popupTimerClear(); } - onWindowMessage(e) { - const action = e.data; - const handlers = Frontend.windowMessageHandlers; - if (handlers.hasOwnProperty(action)) { - const handler = handlers[action]; - handler(this); - } - } - - async onResize() { - if (this.textSourceCurrent !== null && await this.popup.isVisibleAsync()) { - const textSource = this.textSourceCurrent; - this.lastShowPromise = this.popup.showContent( - textSource.getRect(), - textSource.getWritingMode() - ); - } - } - onClick(e) { if (this.preventNextClick) { this.preventNextClick = false; @@ -157,6 +138,19 @@ class Frontend { } } + onAuxClick(e) { + this.preventNextContextMenu = false; + } + + onContextMenu(e) { + if (this.preventNextContextMenu) { + this.preventNextContextMenu = false; + e.preventDefault(); + e.stopPropagation(); + return false; + } + } + onTouchStart(e) { if (this.primaryTouchIdentifier !== null || e.changedTouches.length === 0) { return; @@ -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); } }