summaryrefslogtreecommitdiff
path: root/ext/mixed/js/text-scanner.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-09 21:07:11 -0400
committerGitHub <noreply@github.com>2020-08-09 21:07:11 -0400
commit2a86d6609210a586ec32c48a99904c9b64744d04 (patch)
treee87b3a7abb84c1d1dbb51d27de100288d00df155 /ext/mixed/js/text-scanner.js
parent9f8f83508e6d8e469b8cd89c1fb3ec85601401d8 (diff)
DOM + DocumentUtil merge (#727)
* Add DOM functions to DocumentUtil * Use DocumentUtil instead of DOM * Remove DOM * Move document-util.js into mixed
Diffstat (limited to 'ext/mixed/js/text-scanner.js')
-rw-r--r--ext/mixed/js/text-scanner.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index 923784b3..d0256b1e 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -16,7 +16,7 @@
*/
/* global
- * DOM
+ * DocumentUtil
*/
class TextScanner extends EventDispatcher {
@@ -155,8 +155,8 @@ class TextScanner extends EventDispatcher {
if (this._ignoreNodes !== null && clonedTextSource.range) {
length = clonedTextSource.text().length;
while (clonedTextSource.range && length > 0) {
- const nodes = DOM.getNodesInRange(clonedTextSource.range);
- if (!DOM.anyNodeMatchesSelector(nodes, this._ignoreNodes)) {
+ const nodes = DocumentUtil.getNodesInRange(clonedTextSource.range);
+ if (!DocumentUtil.anyNodeMatchesSelector(nodes, this._ignoreNodes)) {
break;
}
--length;
@@ -204,16 +204,16 @@ class TextScanner extends EventDispatcher {
_onMouseMove(e) {
this._scanTimerClear();
- if (this._pendingLookup || DOM.isMouseButtonDown(e, 'primary')) {
+ if (this._pendingLookup || DocumentUtil.isMouseButtonDown(e, 'primary')) {
return;
}
- const modifiers = DOM.getActiveModifiers(e);
+ const modifiers = DocumentUtil.getActiveModifiers(e);
this.trigger('activeModifiersChanged', {modifiers});
if (!(
this._isScanningModifierPressed(this._modifier, e) ||
- (this._useMiddleMouse && DOM.isMouseButtonDown(e, 'auxiliary'))
+ (this._useMiddleMouse && DocumentUtil.isMouseButtonDown(e, 'auxiliary'))
)) {
return;
}
@@ -241,7 +241,7 @@ class TextScanner extends EventDispatcher {
return false;
}
- if (DOM.isMouseButtonDown(e, 'primary')) {
+ if (DocumentUtil.isMouseButtonDown(e, 'primary')) {
this._scanTimerClear();
this.clearSelection(false);
}
@@ -284,7 +284,7 @@ class TextScanner extends EventDispatcher {
this._preventNextClick = false;
const primaryTouch = e.changedTouches[0];
- if (DOM.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, window.getSelection())) {
+ if (DocumentUtil.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, window.getSelection())) {
return;
}