mirror of
https://github.com/penpot/penpot.git
synced 2025-06-08 11:01:40 +02:00
🎉 Add workspace read-only setting
This commit is contained in:
parent
6b7adec617
commit
cd47c0356a
22 changed files with 567 additions and 460 deletions
|
@ -84,7 +84,9 @@
|
|||
;; things go weird.
|
||||
|
||||
(defn use-sortable
|
||||
[& {:keys [data-type data on-drop on-drag on-hold disabled detect-center?] :as opts}]
|
||||
[& {:keys [data-type data on-drop on-drag on-hold disabled detect-center? draggable?]
|
||||
:or {draggable? true}
|
||||
:as opts}]
|
||||
(let [ref (mf/use-ref)
|
||||
state (mf/use-state {:over nil
|
||||
:timer nil
|
||||
|
@ -169,7 +171,7 @@
|
|||
on-mount
|
||||
(fn []
|
||||
(let [dom (mf/ref-val ref)]
|
||||
(.setAttribute dom "draggable" true)
|
||||
(.setAttribute dom "draggable" draggable?)
|
||||
|
||||
;; Register all events in the (default) bubble mode, so that they
|
||||
;; are captured by the most leaf item. The handler will stop
|
||||
|
@ -189,7 +191,7 @@
|
|||
(.removeEventListener dom "dragend" on-drag-end))))]
|
||||
|
||||
(mf/use-effect
|
||||
(mf/deps data on-drop)
|
||||
(mf/deps data on-drop draggable?)
|
||||
on-mount)
|
||||
|
||||
[(deref state) ref]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue