0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

Use strings for layout ids instead keywords.

This commit is contained in:
Andrey Antukh 2016-03-15 22:25:45 +02:00
parent a522682ee4
commit 098d38e079
3 changed files with 29 additions and 24 deletions

View file

@ -28,11 +28,11 @@
{:name [sc/required sc/string]
:width [sc/required sc/integer]
:height [sc/required sc/integer]
:layout [sc/keyword]})
:layout [sc/required sc/string]})
(def ^:static +create-page-schema+
{:name [sc/required sc/string]
:layout [sc/keyword]
:layout [sc/required sc/string]
:width [sc/required sc/integer]
:height [sc/required sc/integer]
:project [sc/required sc/uuid]})
@ -41,7 +41,7 @@
{:name [sc/required sc/string]
:width [sc/required sc/integer]
:height [sc/required sc/integer]
:layout [sc/keyword]})
:layout [sc/required sc/string]})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Helpers

View file

@ -32,28 +32,33 @@
(def +ordering-options+ {:name "ds.project-ordering.by-name"
:created "ds.project-ordering.by-creation-date"})
(def +layouts+ {:mobile {:name "Mobile"
:id "mobile"
:width 320
:height 480}
:tablet {:name "Tablet"
:id "tablet"
:width 1024
:height 768}
:notebook {:name "Notebook"
:id "notebook"
:width 1366
:height 768}
:desktop {:name "Desktop"
:id "desktop"
:width 1920
:height 1080}})
(def +layouts+
{"mobile"
{:name "Mobile"
:id "mobile"
:width 320
:height 480}
"tablet"
{:name "Tablet"
:id "tablet"
:width 1024
:height 768}
"notebook"
{:name "Notebook"
:id "notebook"
:width 1366
:height 768}
"desktop"
{:name "Desktop"
:id "desktop"
:width 1920
:height 1080}})
(def ^:static ^:private
+project-defaults+ {:name ""
:width 1920
:height 1080
:layout :desktop})
:layout "desktop"})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Top Menu

View file

@ -167,10 +167,10 @@
:on-change #(update-size :height %)}]]
[:div.input-radio.radio-primary
(layout-input local page :mobile)
(layout-input local page :tablet)
(layout-input local page :notebook)
(layout-input local page :desktop)]
(layout-input local page "mobile")
(layout-input local page "tablet")
(layout-input local page "notebook")
(layout-input local page "desktop")]
(when valid?
[:input#project-btn.btn-primary