diff --git a/src/uxbox/ui/confirm.cljs b/src/uxbox/ui/confirm.cljs new file mode 100644 index 0000000000..3b97360945 --- /dev/null +++ b/src/uxbox/ui/confirm.cljs @@ -0,0 +1,32 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) 2016 Andrey Antukh +;; Copyright (c) 2016 Juan de la Cruz + +(ns uxbox.ui.confirm + (:require [sablono.core :as html :refer-macros [html]] + [uxbox.ui.icons :as i] + [uxbox.ui.mixins :as mx] + [uxbox.util.dom :as dom] + [uxbox.ui.lightbox :as lightbox])) + +(defn- confirm-dialog-render + [own] + (html + [:div.lightbox-body.confirm-dialog + [:span "HERE"] + [:a.close {:href "#" + :on-click #(do (dom/prevent-default %) + (lightbox/close!))} i/close]])) + +(def confirm-dialog + (mx/component + {:render confirm-dialog-render + :name "confirm-dialog" + :mixins []})) + +(defmethod lightbox/render-lightbox :confirm + [_] + (confirm-dialog)) diff --git a/src/uxbox/ui/workspace.cljs b/src/uxbox/ui/workspace.cljs index 1addc4c2f2..cf1226b09d 100644 --- a/src/uxbox/ui/workspace.cljs +++ b/src/uxbox/ui/workspace.cljs @@ -18,6 +18,7 @@ [uxbox.ui.icons :as i] [uxbox.ui.mixins :as mx] [uxbox.ui.messages :as uum] + [uxbox.ui.confirm] [uxbox.ui.workspace.base :as uuwb] [uxbox.ui.workspace.shortcuts :as wshortcuts] [uxbox.ui.workspace.header :refer (header)] diff --git a/src/uxbox/ui/workspace/header.cljs b/src/uxbox/ui/workspace/header.cljs index 989b0768b0..dd587b737e 100644 --- a/src/uxbox/ui/workspace/header.cljs +++ b/src/uxbox/ui/workspace/header.cljs @@ -60,7 +60,8 @@ flags (rum/react wb/flags-l) toggle #(rs/emit! (dw/toggle-flag %)) ;; TODO: temporary - open-clipboard-dialog #(lightbox/open! :clipboard)] + open-clipboard-dialog #(lightbox/open! :clipboard) + open-confirm-dialog #(lightbox/open! :confirm)] (html [:header#workspace-bar.workspace-bar [:div.main-icon @@ -102,7 +103,8 @@ :on-click open-clipboard-dialog} i/undo] [:li.tooltip.tooltip-bottom - {:alt "Redo (Ctrl + Shift + Z)"} + {:alt "Redo (Ctrl + Shift + Z)" + :on-click open-confirm-dialog} i/redo]] [:ul.options-btn ;; TODO: refactor