From 6795a4d9a500097f301c4ddc82092e934b9e4d7b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 25 Sep 2016 15:20:10 +0300 Subject: [PATCH] Add deletion confirmation to image collection and image item. --- src/uxbox/main/ui/dashboard/images.cljs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/uxbox/main/ui/dashboard/images.cljs b/src/uxbox/main/ui/dashboard/images.cljs index 8fe4eca3f..3627651a5 100644 --- a/src/uxbox/main/ui/dashboard/images.cljs +++ b/src/uxbox/main/ui/dashboard/images.cljs @@ -97,8 +97,11 @@ (dom/prevent-default e) (dom/stop-propagation e) (on-save e)))) + + (delete [] + (rs/emit! (di/delete-collection (:id coll)))) (on-delete [] - (rs/emit! (di/delete-collection (:id coll))))] + (udl/open! :confirm {:on-accept delete}))] [:div.dashboard-title [:h2 (if edit? @@ -205,8 +208,10 @@ (mx/defc grid-options [coll] (let [own? (= (:type coll) :own)] - (letfn [(on-delete [event] - (rs/emit! (di/delete-selected)))] + (letfn [(delete [] + (rs/emit! (di/delete-selected))) + (on-delete [event] + (udl/open! :confirm {:on-accept delete}))] ;; MULTISELECT OPTIONS BAR [:div.multiselect-bar (if own?