mirror of
https://github.com/penpot/penpot.git
synced 2025-07-04 03:47:17 +02:00
Add activate flag event for proper flag activation independently of state.
This commit is contained in:
parent
41073a7b57
commit
c743c94450
1 changed files with 12 additions and 1 deletions
|
@ -85,6 +85,17 @@
|
||||||
(assoc-in state [:workspace :drawing] shape)
|
(assoc-in state [:workspace :drawing] shape)
|
||||||
(update-in state [:workspace] dissoc :drawing)))))
|
(update-in state [:workspace] dissoc :drawing)))))
|
||||||
|
|
||||||
|
;; --- Activate Workspace Flag
|
||||||
|
|
||||||
|
(defrecord ActivateFlag [flag]
|
||||||
|
rs/UpdateEvent
|
||||||
|
(-apply-update [_ state]
|
||||||
|
(update-in state [:workspace :flags] conj flag)))
|
||||||
|
|
||||||
|
(defn activate-flag
|
||||||
|
[flag]
|
||||||
|
(ActivateFlag. flag))
|
||||||
|
|
||||||
;; --- Copy to Clipboard
|
;; --- Copy to Clipboard
|
||||||
|
|
||||||
(defrecord CopyToClipboard []
|
(defrecord CopyToClipboard []
|
||||||
|
@ -172,7 +183,7 @@
|
||||||
:x-axis (:grid/x-axis opts c/grid-x-axis)
|
:x-axis (:grid/x-axis opts c/grid-x-axis)
|
||||||
:y-axis (:grid/y-axis opts c/grid-y-axis)}]
|
:y-axis (:grid/y-axis opts c/grid-y-axis)}]
|
||||||
(->> (uw/send! worker message)
|
(->> (uw/send! worker message)
|
||||||
(rx/map #(toggle-flag :alignment/indexed))))))
|
(rx/map #(activate-flag :alignment/indexed))))))
|
||||||
|
|
||||||
(defn initialize-alignment-index
|
(defn initialize-alignment-index
|
||||||
[id]
|
[id]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue