aboutsummaryrefslogtreecommitdiff
path: root/internal/ui/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'internal/ui/static/js')
-rw-r--r--internal/ui/static/js/app.js2
-rw-r--r--internal/ui/static/js/dom_helper.js10
-rw-r--r--internal/ui/static/js/touch_handler.js2
3 files changed, 2 insertions, 12 deletions
diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js
index 599119a2..9764d3f6 100644
--- a/internal/ui/static/js/app.js
+++ b/internal/ui/static/js/app.js
@@ -571,7 +571,7 @@ function isListView() {
function findEntry(element) {
if (isListView()) {
if (element) {
- return DomHelper.findParent(element, "item");
+ return element.closest(".item")
} else {
return document.querySelector(".current-item");
}
diff --git a/internal/ui/static/js/dom_helper.js b/internal/ui/static/js/dom_helper.js
index fffa6965..fe0afcac 100644
--- a/internal/ui/static/js/dom_helper.js
+++ b/internal/ui/static/js/dom_helper.js
@@ -34,16 +34,6 @@ class DomHelper {
return result;
}
- static findParent(element, selector) {
- for (; element && element !== document; element = element.parentNode) {
- if (element.classList.contains(selector)) {
- return element;
- }
- }
-
- return null;
- }
-
static hasPassiveEventListenerOption() {
var passiveSupported = false;
diff --git a/internal/ui/static/js/touch_handler.js b/internal/ui/static/js/touch_handler.js
index 99c1d5b2..4e2657cb 100644
--- a/internal/ui/static/js/touch_handler.js
+++ b/internal/ui/static/js/touch_handler.js
@@ -31,7 +31,7 @@ class TouchHandler {
return element;
}
- return DomHelper.findParent(element, "entry-swipe");
+ return element.closest(".entry-swipe")
}
onItemTouchStart(event) {