summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-24 21:15:02 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-28 17:03:42 -0400
commit9178636613461c1e333abbb9c67e7c82948fdfeb (patch)
tree4b90905e18f000bc0ea285df25eb715b8ab5e327 /ext
parentc74c466c36cc3183e4044e8a7583a0a95609f0e1 (diff)
Remove setters
Diffstat (limited to 'ext')
-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);