mirror of
https://github.com/penpot/penpot.git
synced 2025-02-01 11:59:17 -05:00
Simplify
This commit is contained in:
parent
113fc9891b
commit
cbd5d42069
1 changed files with 4 additions and 7 deletions
|
@ -364,14 +364,11 @@
|
||||||
(generic-attribute-actions #{:x} "X" context-data)
|
(generic-attribute-actions #{:x} "X" context-data)
|
||||||
(generic-attribute-actions #{:y} "Y" context-data)))}))
|
(generic-attribute-actions #{:y} "Y" context-data)))}))
|
||||||
|
|
||||||
(defn shape-attribute-actions [{:keys [type token] :as context-data}]
|
(defn generate-menu-entries [{:keys [type token] :as context-data}]
|
||||||
(when-let [with-actions (get shape-attribute-actions-map (or type (:type token)))]
|
|
||||||
(with-actions context-data)))
|
|
||||||
|
|
||||||
(defn generate-menu-entries [{:keys [token selected-shapes] :as context-data}]
|
|
||||||
(let [{:keys [modal]} (get wtc/token-types (:type token))
|
(let [{:keys [modal]} (get wtc/token-types (:type token))
|
||||||
attribute-actions (when (seq selected-shapes)
|
with-actions (get shape-attribute-actions-map (or type (:type token)))
|
||||||
(shape-attribute-actions context-data))
|
attribute-actions (when with-actions
|
||||||
|
(with-actions context-data))
|
||||||
default-actions [{:title "Delete Token"
|
default-actions [{:title "Delete Token"
|
||||||
:action #(st/emit! (dt/delete-token (:id token)))}
|
:action #(st/emit! (dt/delete-token (:id token)))}
|
||||||
{:title "Duplicate Token"
|
{:title "Duplicate Token"
|
||||||
|
|
Loading…
Add table
Reference in a new issue