mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 20:46:11 +02:00
Remove hardcoded defaults on page element-options widget.
This commit is contained in:
parent
43bb3a40b3
commit
bbaf80bedf
1 changed files with 9 additions and 7 deletions
|
@ -10,6 +10,7 @@
|
||||||
(:require [lentes.core :as l]
|
(:require [lentes.core :as l]
|
||||||
[potok.core :as ptk]
|
[potok.core :as ptk]
|
||||||
[uxbox.store :as st]
|
[uxbox.store :as st]
|
||||||
|
[uxbox.main.constants :as c]
|
||||||
[uxbox.main.data.pages :as udp]
|
[uxbox.main.data.pages :as udp]
|
||||||
[uxbox.main.data.workspace :as udw]
|
[uxbox.main.data.workspace :as udw]
|
||||||
[uxbox.main.data.lightbox :as udl]
|
[uxbox.main.data.lightbox :as udl]
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
{:mixins [mx/static mx/reactive]}
|
{:mixins [mx/static mx/reactive]}
|
||||||
[own menu]
|
[own menu]
|
||||||
(let [{:keys [id metadata] :as page} (mx/react page-ref)
|
(let [{:keys [id metadata] :as page} (mx/react page-ref)
|
||||||
{:keys [width height background] :as metadata} metadata]
|
metadata (merge c/page-metadata metadata)]
|
||||||
(letfn [(on-width-change []
|
(letfn [(on-width-change []
|
||||||
(when-let [value (-> (mx/ref-node own "width")
|
(when-let [value (-> (mx/ref-node own "width")
|
||||||
(dom/get-value)
|
(dom/get-value)
|
||||||
|
@ -77,18 +78,19 @@
|
||||||
[:span "Background color"]
|
[:span "Background color"]
|
||||||
[:div.row-flex.color-data
|
[:div.row-flex.color-data
|
||||||
[:span.color-th
|
[:span.color-th
|
||||||
{:style {:background-color (or background "#ffffff")}
|
{:style {:background-color (:background metadata)}
|
||||||
:on-click show-color-picker}]
|
:on-click show-color-picker}]
|
||||||
[:div.color-info
|
[:div.color-info
|
||||||
[:input
|
[:input
|
||||||
{:on-change on-color-change
|
{:on-change on-color-change
|
||||||
:ref "color"
|
:ref "color"
|
||||||
:value (or background "#ffffff")}]]]]])))
|
:value (:background metadata)}]]]]])))
|
||||||
|
|
||||||
(mx/defcs grid-options-menu
|
(mx/defcs grid-options-menu
|
||||||
{:mixins [mx/static mx/reactive]}
|
{:mixins [mx/static mx/reactive]}
|
||||||
[own menu]
|
[own menu]
|
||||||
(let [{:keys [id metadata] :as page} (mx/react page-ref)]
|
(let [{:keys [id metadata] :as page} (mx/react page-ref)
|
||||||
|
metadata (merge c/page-metadata metadata)]
|
||||||
(letfn [(on-x-change []
|
(letfn [(on-x-change []
|
||||||
(when-let [value (-> (mx/ref-node own "x-axis")
|
(when-let [value (-> (mx/ref-node own "x-axis")
|
||||||
(dom/get-value)
|
(dom/get-value)
|
||||||
|
@ -131,20 +133,20 @@
|
||||||
[:input.input-text
|
[:input.input-text
|
||||||
{:type "number"
|
{:type "number"
|
||||||
:ref "x-axis"
|
:ref "x-axis"
|
||||||
:value (:grid-x-axis metadata 10)
|
:value (:grid-x-axis metadata)
|
||||||
:on-change on-x-change
|
:on-change on-x-change
|
||||||
:placeholder "x"}]]
|
:placeholder "x"}]]
|
||||||
[:div.input-element.pixels
|
[:div.input-element.pixels
|
||||||
[:input.input-text
|
[:input.input-text
|
||||||
{:type "number"
|
{:type "number"
|
||||||
:ref "y-axis"
|
:ref "y-axis"
|
||||||
:value (:grid-y-axis metadata 10)
|
:value (:grid-y-axis metadata)
|
||||||
:on-change on-y-change
|
:on-change on-y-change
|
||||||
:placeholder "y"}]]]
|
:placeholder "y"}]]]
|
||||||
[:span "Color"]
|
[:span "Color"]
|
||||||
[:div.row-flex.color-data
|
[:div.row-flex.color-data
|
||||||
[:span.color-th
|
[:span.color-th
|
||||||
{:style {:background-color (:grid-color metadata "#cccccc")}
|
{:style {:background-color (:grid-color metadata)}
|
||||||
:on-click show-color-picker}]
|
:on-click show-color-picker}]
|
||||||
[:div.color-info
|
[:div.color-info
|
||||||
[:input
|
[:input
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue