0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 08:29:42 -05:00

Add deletion confirmation to image collection and image item.

This commit is contained in:
Andrey Antukh 2016-09-25 15:20:10 +03:00
parent 77dec1d0e6
commit 6795a4d9a5
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -97,8 +97,11 @@
(dom/prevent-default e) (dom/prevent-default e)
(dom/stop-propagation e) (dom/stop-propagation e)
(on-save e)))) (on-save e))))
(delete []
(rs/emit! (di/delete-collection (:id coll))))
(on-delete [] (on-delete []
(rs/emit! (di/delete-collection (:id coll))))] (udl/open! :confirm {:on-accept delete}))]
[:div.dashboard-title [:div.dashboard-title
[:h2 [:h2
(if edit? (if edit?
@ -205,8 +208,10 @@
(mx/defc grid-options (mx/defc grid-options
[coll] [coll]
(let [own? (= (:type coll) :own)] (let [own? (= (:type coll) :own)]
(letfn [(on-delete [event] (letfn [(delete []
(rs/emit! (di/delete-selected)))] (rs/emit! (di/delete-selected)))
(on-delete [event]
(udl/open! :confirm {:on-accept delete}))]
;; MULTISELECT OPTIONS BAR ;; MULTISELECT OPTIONS BAR
[:div.multiselect-bar [:div.multiselect-bar
(if own? (if own?