mirror of
https://github.com/penpot/penpot.git
synced 2026-08-07 13:29:07 +00:00
🐛 Fix show measurements shortcut
This commit is contained in:
parent
15f15538a4
commit
268a77934a
@ -207,13 +207,16 @@
|
||||
(remove #(:disabled (second %)))
|
||||
(run! (fn [[key {:keys [command fn type overwrite]}]]
|
||||
(let [callback (wrap-cb key fn)
|
||||
undefined (js* "(void 0)")
|
||||
commands (if (vector? command)
|
||||
(into-array command)
|
||||
#js [command])]
|
||||
(if type
|
||||
(mousetrap/bind commands callback type overwrite)
|
||||
(mousetrap/bind commands callback undefined overwrite)))))))
|
||||
(if (vector? type)
|
||||
(do (mousetrap/bind commands callback (nth type 0) overwrite)
|
||||
(mousetrap/bind commands callback (nth type 1) overwrite))
|
||||
(let [undefined (js* "(void 0)")]
|
||||
(if type
|
||||
(mousetrap/bind commands callback type overwrite)
|
||||
(mousetrap/bind commands callback undefined overwrite)))))))))
|
||||
|
||||
(defn- reset!
|
||||
([]
|
||||
|
||||
@ -150,10 +150,12 @@
|
||||
|
||||
:show-measure {:tooltip (ds/alt "")
|
||||
:command ["alt" "."]
|
||||
:type "keydown"
|
||||
:type ["keydown" "keyup"]
|
||||
:subsections [:tools]
|
||||
:section [:workspace]
|
||||
:fn #(emit-when-no-readonly (dw/toggle-distances-display true))}
|
||||
:fn #(emit-when-no-readonly
|
||||
(let [type (.-type %)]
|
||||
(dw/toggle-distances-display (if (= type "keydown") true false))))}
|
||||
|
||||
:escape {:tooltip (ds/esc)
|
||||
:command "escape"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user