Skip to content

Commit

Permalink
confirmation modal on workspace delete
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jun 6, 2016
1 parent 2baef61 commit 9fa63b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cljs/ulysses/components/layout.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[modal-dialog
title
action-label
on-action
(fn [] (on-action) (on-close))
on-close
children]])))))

Expand Down
2 changes: 1 addition & 1 deletion src/cljs/ulysses/db.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
;; interface
;; -------------------------------------------------------------------------

; modal: {:title String :action-label String :on-action Function :children Hiccup}
; modal: {:title Hiccup | String, :action-label String :on-action Function :children Hiccup | String
:modal nil})

(defn refresh-keys
Expand Down
8 changes: 7 additions & 1 deletion src/cljs/ulysses/pages/builder.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@
[:div.workspace-footer
(when workspace-current
[hink
#(dispatch [:workspace-delete])
(fn []
(dispatch
[:modal
{:title [:span "Delete Workspace " [:i (:name workspace-current)]]
:action-label "Delete"
:on-action #(dispatch [:workspace-delete])
:children "Are you sure you want to delete this workspace?"}]))
(classes-attr :btn :btn-sm :btn-danger)
"Delete Current Workspace"])])

Expand Down

0 comments on commit 9fa63b9

Please sign in to comment.