feat: drag drop a block on mobile

haptics enabled.
This commit is contained in:
Tienson Qin
2025-05-25 06:38:45 +08:00
parent f10590f2fe
commit 6f9f610c41
2 changed files with 47 additions and 37 deletions

View File

@@ -281,16 +281,6 @@
(def *touch-start (atom nil))
(defn- target-disable-swipe?
[target]
(let [user-defined-tags (get-in (state/get-config)
[:mobile :gestures/disabled-in-block-with-tags])]
(or (.closest target ".dsl-query")
(.closest target ".drawer")
(.closest target ".draw-wrap")
(some #(.closest target (util/format "[data-refs-self*=%s]" %))
user-defined-tags))))
(defn on-touch-start
[event uuid]
(util/stop-propagation event)
@@ -377,8 +367,10 @@
(catch :default e
(js/console.error e))
(finally
(reset! *swipe nil))))))
(reset! *swipe nil)
(reset! *touch-start nil))))))
(defn on-touch-cancel
[_e]
(reset! *swipe nil))
(reset! *swipe nil)
(reset! *touch-start nil))