From 1434cb62f5f3fa14a145a942e2a3657c2e0c0f0c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 19 Mar 2020 17:39:53 +0100 Subject: [PATCH] :tada: Add many helpers to uxbox.util.dom ns. --- frontend/src/uxbox/util/dom.cljs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/uxbox/util/dom.cljs b/frontend/src/uxbox/util/dom.cljs index 4d9100302..a7730eb5e 100644 --- a/frontend/src/uxbox/util/dom.cljs +++ b/frontend/src/uxbox/util/dom.cljs @@ -14,6 +14,7 @@ [cuerdas.core :as str] [beicon.core :as rx] [cuerdas.core :as str] + [uxbox.util.geom.point :as gpt] [uxbox.util.blob :as blob])) ;; --- Deprecated methods @@ -135,4 +136,14 @@ [el query] (.querySelector el query)) +(defn get-client-position + [event] + (let [x (.-clientX event) + y (.-clientY event)] + (gpt/point x y))) +(defn get-offset-position + [event] + (let [x (.-offsetX event) + y (.-offsetY event)] + (gpt/point x y)))