mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 11:51:41 +02:00
Add download dummy lightbox.
This commit is contained in:
parent
15d5748922
commit
cb003407b2
3 changed files with 53 additions and 6 deletions
|
@ -22,6 +22,7 @@
|
|||
[uxbox.ui.confirm]
|
||||
[uxbox.ui.keyboard :as kbd]
|
||||
[uxbox.ui.workspace.scroll :as scroll]
|
||||
[uxbox.ui.workspace.download]
|
||||
[uxbox.ui.workspace.base :as wb]
|
||||
[uxbox.ui.workspace.shortcuts :refer (shortcuts-mixin)]
|
||||
[uxbox.ui.workspace.header :refer (header)]
|
||||
|
|
47
src/uxbox/ui/workspace/download.cljs
Normal file
47
src/uxbox/ui/workspace/download.cljs
Normal file
|
@ -0,0 +1,47 @@
|
|||
;; 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 <niwi@niwi.nz>
|
||||
;; Copyright (c) 2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
|
||||
|
||||
(ns uxbox.ui.workspace.download
|
||||
(:require [sablono.core :as html :refer-macros [html]]
|
||||
[lentes.core :as l]
|
||||
[rum.core :as rum]
|
||||
[uxbox.constants :as c]
|
||||
[uxbox.state :as st]
|
||||
[uxbox.rstore :as rs]
|
||||
[uxbox.data.pages :as udp]
|
||||
[uxbox.data.forms :as udf]
|
||||
[uxbox.data.workspace :as udw]
|
||||
[uxbox.data.lightbox :as udl]
|
||||
[uxbox.ui.icons :as i]
|
||||
[uxbox.ui.mixins :as mx]
|
||||
[uxbox.ui.forms :as forms]
|
||||
[uxbox.ui.lightbox :as lbx]
|
||||
[uxbox.ui.colorpicker :as uucp]
|
||||
[uxbox.ui.workspace.base :as wb]
|
||||
[uxbox.util.dom :as dom]
|
||||
[uxbox.util.data :refer (parse-int)]))
|
||||
|
||||
|
||||
(defn- download-dialog-render
|
||||
[own]
|
||||
(html
|
||||
[:div.lightbox-body.settings
|
||||
[:h3 "Download Dialog"]
|
||||
[:p "Content here"]
|
||||
[:a.close {:href "#"
|
||||
:on-click #(do (dom/prevent-default %)
|
||||
(udl/close!))} i/close]]))
|
||||
|
||||
(def download-dialog
|
||||
(mx/component
|
||||
{:render download-dialog-render
|
||||
:name "download-dialog"
|
||||
:mixins []}))
|
||||
|
||||
(defmethod lbx/render-lightbox :download
|
||||
[_]
|
||||
(download-dialog))
|
|
@ -59,7 +59,8 @@
|
|||
|
||||
(defn on-download-clicked
|
||||
[event page]
|
||||
(let [content (.-innerHTML (.getElementById js/document "page-layout"))
|
||||
(udl/open! :download)
|
||||
#_(let [content (.-innerHTML (.getElementById js/document "page-layout"))
|
||||
width (:width page)
|
||||
height (:height page)
|
||||
html (str "<svg width='" width "' height='" height "'>" content "</svg>")
|
||||
|
@ -125,11 +126,9 @@
|
|||
[:ul.options-btn
|
||||
;; TODO: refactor
|
||||
[:li.tooltip.tooltip-bottom
|
||||
{:alt "Export (Ctrl + E)"}
|
||||
;; page-title
|
||||
[:a {:download (str (:name page) ".svg")
|
||||
:href "#" :on-click on-download-clicked}
|
||||
i/export]]
|
||||
{:alt "Export (Ctrl + E)"
|
||||
:on-click on-download-clicked}
|
||||
i/export]
|
||||
[:li.tooltip.tooltip-bottom
|
||||
{:alt "Image (Ctrl + I)"
|
||||
:on-click open-confirm-dialog}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue