0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Fix edit modal not opening

This commit is contained in:
Florian Schroedl 2024-07-24 16:10:41 +02:00
parent cb942996a9
commit b9b4abf1e0
2 changed files with 5 additions and 2 deletions

View file

@ -33,7 +33,7 @@
:selected-pred #(seq (% ids-by-attributes))}))
(defn generic-attribute-actions [attributes title {:keys [token selected-shapes]}]
(let [{:keys [on-update-shape]} (get wtty/token-types (:type token))
(let [{:keys [on-update-shape]} (wtty/get-token-properties token)
{:keys [selected-pred shape-ids]} (attribute-actions token selected-shapes attributes)]
(map (fn [attribute]
(let [selected? (selected-pred attribute)
@ -200,7 +200,7 @@
(generic-attribute-actions #{:y} "Y" context-data)))}))
(defn default-actions [{:keys [token]}]
(let [{:keys [modal]} (get wtty/token-types token)]
(let [{:keys [modal]} (wtty/get-token-properties token)]
[{:title "Delete Token"
:action #(st/emit! (dt/delete-token (:id token)))}
{:title "Duplicate Token"

View file

@ -100,5 +100,8 @@
{:label "Text Decoration" :key :text-decoration}
{:label "Text Case" :key :text-case}]}}])))
(defn get-token-properties [token]
(get token-types (:type token)))
(defn token-attributes [token-type]
(get-in token-types [token-type :attributes]))