summaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js42
1 files changed, 14 insertions, 28 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index e7f0bbf7..6d4ba4f8 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -112,8 +112,8 @@ class Frontend {
onMouseDown(e) {
if (this.mouseDownPrevent) {
- this.setMouseDownPrevent(false, false);
- this.setClickPrevent(true);
+ this.mouseDownPrevent = false;
+ this.clickPrevent = true;
e.preventDefault();
e.stopPropagation();
return false;
@@ -148,7 +148,7 @@ class Frontend {
onClick(e) {
if (this.clickPrevent) {
- this.setClickPrevent(false);
+ this.clickPrevent = false;
e.preventDefault();
e.stopPropagation();
return false;
@@ -203,7 +203,7 @@ class Frontend {
onContextMenu(e) {
if (this.contextMenuPrevent) {
- this.setContextMenuPrevent(false, false);
+ this.contextMenuPrevent = false;
e.preventDefault();
e.stopPropagation();
return false;
@@ -435,16 +435,18 @@ class Frontend {
if (touch === null) {
this.primaryTouchIdentifier = null;
this.scrollPrevent = false;
- this.setContextMenuPrevent(false, true);
- this.setMouseDownPrevent(false, true);
- this.setClickPrevent(false);
+ this.clickPrevent = false;
+ // Don't revert context menu and mouse down prevention,
+ // since these events can occur after the touch has ended.
+ // this.contextMenuPrevent = false;
+ // this.mouseDownPrevent = false;
}
else {
this.primaryTouchIdentifier = touch.identifier;
this.scrollPrevent = false;
- this.setContextMenuPrevent(false, false);
- this.setMouseDownPrevent(false, false);
- this.setClickPrevent(false);
+ this.contextMenuPrevent = false;
+ this.mouseDownPrevent = false;
+ this.clickPrevent = false;
const textSourceCurrentPrevious = this.textSourceCurrent !== null ? this.textSourceCurrent.clone() : null;
@@ -459,28 +461,12 @@ class Frontend {
}
this.scrollPrevent = true;
- this.setContextMenuPrevent(true, false);
- this.setMouseDownPrevent(true, false);
+ this.contextMenuPrevent = true;
+ this.mouseDownPrevent = true;
});
}
}
- setContextMenuPrevent(value, delay) {
- if (!delay) {
- this.contextMenuPrevent = value;
- }
- }
-
- setMouseDownPrevent(value, delay) {
- if (!delay) {
- this.mouseDownPrevent = value;
- }
- }
-
- setClickPrevent(value) {
- this.clickPrevent = value;
- }
-
selectionContainsPoint(selection, x, y) {
for (let i = 0; i < selection.rangeCount; ++i) {
const range = selection.getRangeAt(i);