mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -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; "
|
||||
"left: " (- left delta-x) "px;")]
|
||||
(when (or (> delta-x 0) (> delta-y 0))
|
||||
(.setAttribute dropdown "style" new-style))))))
|
||||
(.setAttribute ^js dropdown "style" new-style))))))
|
||||
|
||||
[:& dropdown {:show (boolean mdata)
|
||||
:on-close #(st/emit! dw/hide-context-menu)}
|
||||
|
|
|
@ -165,15 +165,15 @@
|
|||
(defn get-bounding-rect
|
||||
[node]
|
||||
(let [rect (.getBoundingClientRect ^js node)]
|
||||
{:left (.-left rect)
|
||||
:top (.-top rect)
|
||||
:right (.-right rect)
|
||||
:bottom (.-bottom rect)}))
|
||||
{:left (.-left ^js rect)
|
||||
:top (.-top ^js rect)
|
||||
:right (.-right ^js rect)
|
||||
:bottom (.-bottom ^js rect)}))
|
||||
|
||||
(defn get-window-size
|
||||
[]
|
||||
{:width (.-innerWidth js/window)
|
||||
:height (.-innerHeight js/window)})
|
||||
{:width (.-innerWidth ^js js/window)
|
||||
:height (.-innerHeight ^js js/window)})
|
||||
|
||||
(defn focus!
|
||||
[node]
|
||||
|
|
Loading…
Add table
Reference in a new issue