Improve naming
This commit is contained in:
parent
9178636613
commit
a648e05091
@ -32,10 +32,10 @@ class Frontend {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.primaryTouchIdentifier = null;
|
this.primaryTouchIdentifier = null;
|
||||||
this.contextMenuPrevent = false;
|
this.preventNextContextMenu = false;
|
||||||
this.mouseDownPrevent = false;
|
this.preventNextMouseDown = false;
|
||||||
this.clickPrevent = false;
|
this.preventNextClick = false;
|
||||||
this.scrollPrevent = false;
|
this.preventScroll = false;
|
||||||
|
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.eventListeners = [];
|
this.eventListeners = [];
|
||||||
@ -111,9 +111,9 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMouseDown(e) {
|
onMouseDown(e) {
|
||||||
if (this.mouseDownPrevent) {
|
if (this.preventNextMouseDown) {
|
||||||
this.mouseDownPrevent = false;
|
this.preventNextMouseDown = false;
|
||||||
this.clickPrevent = true;
|
this.preventNextClick = true;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
@ -147,8 +147,8 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
if (this.clickPrevent) {
|
if (this.preventNextClick) {
|
||||||
this.clickPrevent = false;
|
this.preventNextClick = false;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
@ -185,7 +185,7 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTouchMove(e) {
|
onTouchMove(e) {
|
||||||
if (!this.scrollPrevent || !e.cancelable || this.primaryTouchIdentifier === null) {
|
if (!this.preventScroll || !e.cancelable || this.primaryTouchIdentifier === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,8 +202,8 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onContextMenu(e) {
|
onContextMenu(e) {
|
||||||
if (this.contextMenuPrevent) {
|
if (this.preventNextContextMenu) {
|
||||||
this.contextMenuPrevent = false;
|
this.preventNextContextMenu = false;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
@ -434,19 +434,19 @@ class Frontend {
|
|||||||
setPrimaryTouch(touch) {
|
setPrimaryTouch(touch) {
|
||||||
if (touch === null) {
|
if (touch === null) {
|
||||||
this.primaryTouchIdentifier = null;
|
this.primaryTouchIdentifier = null;
|
||||||
this.scrollPrevent = false;
|
this.preventScroll = false;
|
||||||
this.clickPrevent = false;
|
this.preventNextClick = false;
|
||||||
// Don't revert context menu and mouse down prevention,
|
// Don't revert context menu and mouse down prevention,
|
||||||
// since these events can occur after the touch has ended.
|
// since these events can occur after the touch has ended.
|
||||||
// this.contextMenuPrevent = false;
|
// this.preventNextContextMenu = false;
|
||||||
// this.mouseDownPrevent = false;
|
// this.preventNextMouseDown = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.primaryTouchIdentifier = touch.identifier;
|
this.primaryTouchIdentifier = touch.identifier;
|
||||||
this.scrollPrevent = false;
|
this.preventScroll = false;
|
||||||
this.contextMenuPrevent = false;
|
this.preventNextContextMenu = false;
|
||||||
this.mouseDownPrevent = false;
|
this.preventNextMouseDown = false;
|
||||||
this.clickPrevent = false;
|
this.preventNextClick = false;
|
||||||
|
|
||||||
const textSourceCurrentPrevious = this.textSourceCurrent !== null ? this.textSourceCurrent.clone() : null;
|
const textSourceCurrentPrevious = this.textSourceCurrent !== null ? this.textSourceCurrent.clone() : null;
|
||||||
|
|
||||||
@ -460,9 +460,9 @@ class Frontend {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scrollPrevent = true;
|
this.preventScroll = true;
|
||||||
this.contextMenuPrevent = true;
|
this.preventNextContextMenu = true;
|
||||||
this.mouseDownPrevent = true;
|
this.preventNextMouseDown = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user