Add open components, and scroll into view to show main component acction

This commit is contained in:
eva 2021-12-28 12:38:25 +01:00 committed by Alonso Torres
parent c69d7f50a3
commit 6dae420254
6 changed files with 148 additions and 85 deletions

View file

@ -354,6 +354,12 @@
([element scroll-top]
(.scrollIntoView ^js element scroll-top)))
(defn scroll-into-view-if-needed!
([element]
(.scrollIntoViewIfNeeded ^js element false))
([element scroll-top]
(.scrollIntoViewIfNeeded ^js element scroll-top)))
(defn is-in-viewport?
[element]
(let [rect (.getBoundingClientRect element)