mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 04:02:12 +02:00
🐛 Add undo to set default grid options operation
This commit is contained in:
parent
51acd2b529
commit
f63657509f
4 changed files with 36 additions and 11 deletions
|
@ -649,8 +649,6 @@
|
|||
:left (gpt/point (- 1) 0)
|
||||
:right (gpt/point 1 0)))
|
||||
|
||||
(s/def ::loc #{:up :down :bottom :top})
|
||||
|
||||
;; --- Delete Selected
|
||||
(defn- delete-shapes
|
||||
[ids]
|
||||
|
@ -724,6 +722,8 @@
|
|||
|
||||
;; --- Shape Vertical Ordering
|
||||
|
||||
(s/def ::loc #{:up :down :bottom :top})
|
||||
|
||||
(defn vertical-order-selected
|
||||
[loc]
|
||||
(us/verify ::loc loc)
|
||||
|
|
|
@ -76,8 +76,12 @@
|
|||
(ptk/reify ::set-default-grid
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(rx/of (dwc/commit-changes [{:type :set-option
|
||||
:option [:saved-grids type]
|
||||
:value params}]
|
||||
[]
|
||||
{:commit-local? true})))))
|
||||
(let [pid (:current-page-id state)
|
||||
prev-value (get-in state [:workspace-data pid :options :saved-grids type])]
|
||||
(rx/of (dwc/commit-changes [{:type :set-option
|
||||
:option [:saved-grids type]
|
||||
:value params}]
|
||||
[{:type :set-option
|
||||
:option [:saved-grids type]
|
||||
:value prev-value}]
|
||||
{:commit-local? true}))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue