mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 07:29:08 -05:00
♻️ Add js hints
This commit is contained in:
parent
3e92425779
commit
89394bba10
2 changed files with 7 additions and 7 deletions
|
@ -140,7 +140,7 @@
|
||||||
new-style (str "top: " (- top delta-y) "px; "
|
new-style (str "top: " (- top delta-y) "px; "
|
||||||
"left: " (- left delta-x) "px;")]
|
"left: " (- left delta-x) "px;")]
|
||||||
(when (or (> delta-x 0) (> delta-y 0))
|
(when (or (> delta-x 0) (> delta-y 0))
|
||||||
(.setAttribute dropdown "style" new-style))))))
|
(.setAttribute ^js dropdown "style" new-style))))))
|
||||||
|
|
||||||
[:& dropdown {:show (boolean mdata)
|
[:& dropdown {:show (boolean mdata)
|
||||||
:on-close #(st/emit! dw/hide-context-menu)}
|
:on-close #(st/emit! dw/hide-context-menu)}
|
||||||
|
|
|
@ -165,15 +165,15 @@
|
||||||
(defn get-bounding-rect
|
(defn get-bounding-rect
|
||||||
[node]
|
[node]
|
||||||
(let [rect (.getBoundingClientRect ^js node)]
|
(let [rect (.getBoundingClientRect ^js node)]
|
||||||
{:left (.-left rect)
|
{:left (.-left ^js rect)
|
||||||
:top (.-top rect)
|
:top (.-top ^js rect)
|
||||||
:right (.-right rect)
|
:right (.-right ^js rect)
|
||||||
:bottom (.-bottom rect)}))
|
:bottom (.-bottom ^js rect)}))
|
||||||
|
|
||||||
(defn get-window-size
|
(defn get-window-size
|
||||||
[]
|
[]
|
||||||
{:width (.-innerWidth js/window)
|
{:width (.-innerWidth ^js js/window)
|
||||||
:height (.-innerHeight js/window)})
|
:height (.-innerHeight ^js js/window)})
|
||||||
|
|
||||||
(defn focus!
|
(defn focus!
|
||||||
[node]
|
[node]
|
||||||
|
|
Loading…
Add table
Reference in a new issue