0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

Other minor fixes on icons and images pages.

Related to unexpected behavior of edition form.
This commit is contained in:
Andrey Antukh 2016-11-10 18:39:13 +01:00
parent 396f16fe21
commit 351db464a5
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
2 changed files with 17 additions and 11 deletions

View file

@ -71,7 +71,7 @@
[own {:keys [id] :as coll}]
(let [local (:rum/local own)
dashboard (mx/react dashboard-ref)
own? (= :builtin (:type coll))
own? (= :own (:type coll))
edit? (:edit @local)]
(letfn [(on-save [e]
(let [dom (mx/ref-node own "input")
@ -104,10 +104,13 @@
:on-key-down on-input-keydown}
(:name coll)]
[:span.close {:on-click on-cancel} i/close]]
[:span.dashboard-title-field
{:on-double-click on-edit}
(:name coll "Storage")])]
(if (and (not own?) coll)
(if own?
[:span.dashboard-title-field
{:on-double-click on-edit}
(:name coll)]
[:span.dashboard-title-field
(:name coll "Storage")]))]
(when (and own? coll)
[:div.edition
(if edit?
[:span {:on-click on-save} i/save]

View file

@ -71,11 +71,11 @@
[own {:keys [id] :as coll}]
(let [local (:rum/local own)
dashboard (mx/react dashboard-ref)
own? (= :builtin (:type coll))
own? (= :own (:type coll))
edit? (:edit @local)]
(letfn [(on-save [e]
(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)))
(swap! local assoc :edit false)))
(on-cancel [e]
@ -104,10 +104,13 @@
:on-key-down on-input-keydown}
(:name coll)]
[:span.close {:on-click on-cancel} i/close]]
[:span.dashboard-title-field
{:on-double-click on-edit}
(:name coll "Storage")])]
(if (and (not own?) coll)
(if own?
[:span.dashboard-title-field
{:on-double-click on-edit}
(:name coll)]
[:span.dashboard-title-field
(:name coll "Storage")]))]
(when (and own? coll)
[:div.edition
(if edit?
[:span {:on-click on-save} i/save]