mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 15:51:37 -05:00
Other minor fixes on icons and images pages.
Related to unexpected behavior of edition form.
This commit is contained in:
parent
396f16fe21
commit
351db464a5
2 changed files with 17 additions and 11 deletions
|
@ -71,7 +71,7 @@
|
||||||
[own {:keys [id] :as coll}]
|
[own {:keys [id] :as coll}]
|
||||||
(let [local (:rum/local own)
|
(let [local (:rum/local own)
|
||||||
dashboard (mx/react dashboard-ref)
|
dashboard (mx/react dashboard-ref)
|
||||||
own? (= :builtin (:type coll))
|
own? (= :own (:type coll))
|
||||||
edit? (:edit @local)]
|
edit? (:edit @local)]
|
||||||
(letfn [(on-save [e]
|
(letfn [(on-save [e]
|
||||||
(let [dom (mx/ref-node own "input")
|
(let [dom (mx/ref-node own "input")
|
||||||
|
@ -104,10 +104,13 @@
|
||||||
:on-key-down on-input-keydown}
|
:on-key-down on-input-keydown}
|
||||||
(:name coll)]
|
(:name coll)]
|
||||||
[:span.close {:on-click on-cancel} i/close]]
|
[:span.close {:on-click on-cancel} i/close]]
|
||||||
[:span.dashboard-title-field
|
(if own?
|
||||||
{:on-double-click on-edit}
|
[:span.dashboard-title-field
|
||||||
(:name coll "Storage")])]
|
{:on-double-click on-edit}
|
||||||
(if (and (not own?) coll)
|
(:name coll)]
|
||||||
|
[:span.dashboard-title-field
|
||||||
|
(:name coll "Storage")]))]
|
||||||
|
(when (and own? coll)
|
||||||
[:div.edition
|
[:div.edition
|
||||||
(if edit?
|
(if edit?
|
||||||
[:span {:on-click on-save} i/save]
|
[:span {:on-click on-save} i/save]
|
||||||
|
|
|
@ -71,11 +71,11 @@
|
||||||
[own {:keys [id] :as coll}]
|
[own {:keys [id] :as coll}]
|
||||||
(let [local (:rum/local own)
|
(let [local (:rum/local own)
|
||||||
dashboard (mx/react dashboard-ref)
|
dashboard (mx/react dashboard-ref)
|
||||||
own? (= :builtin (:type coll))
|
own? (= :own (:type coll))
|
||||||
edit? (:edit @local)]
|
edit? (:edit @local)]
|
||||||
(letfn [(on-save [e]
|
(letfn [(on-save [e]
|
||||||
(let [dom (mx/ref-node own "input")
|
(let [dom (mx/ref-node own "input")
|
||||||
name (.-innerText dom)]
|
name (dom/get-inner-text dom)]
|
||||||
(rs/emit! (di/rename-collection id (str/trim name)))
|
(rs/emit! (di/rename-collection id (str/trim name)))
|
||||||
(swap! local assoc :edit false)))
|
(swap! local assoc :edit false)))
|
||||||
(on-cancel [e]
|
(on-cancel [e]
|
||||||
|
@ -104,10 +104,13 @@
|
||||||
:on-key-down on-input-keydown}
|
:on-key-down on-input-keydown}
|
||||||
(:name coll)]
|
(:name coll)]
|
||||||
[:span.close {:on-click on-cancel} i/close]]
|
[:span.close {:on-click on-cancel} i/close]]
|
||||||
[:span.dashboard-title-field
|
(if own?
|
||||||
{:on-double-click on-edit}
|
[:span.dashboard-title-field
|
||||||
(:name coll "Storage")])]
|
{:on-double-click on-edit}
|
||||||
(if (and (not own?) coll)
|
(:name coll)]
|
||||||
|
[:span.dashboard-title-field
|
||||||
|
(:name coll "Storage")]))]
|
||||||
|
(when (and own? coll)
|
||||||
[:div.edition
|
[:div.edition
|
||||||
(if edit?
|
(if edit?
|
||||||
[:span {:on-click on-save} i/save]
|
[:span {:on-click on-save} i/save]
|
||||||
|
|
Loading…
Add table
Reference in a new issue