mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 22:57:19 +02:00
🎉 Add preserve scroll option
This commit is contained in:
parent
3d59d31b0a
commit
f913816d87
14 changed files with 94 additions and 12 deletions
|
@ -340,6 +340,14 @@
|
|||
(defn remove-attribute [^js node ^string attr]
|
||||
(.removeAttribute node attr))
|
||||
|
||||
(defn get-scroll-pos
|
||||
[element]
|
||||
(.-scrollTop ^js element))
|
||||
|
||||
(defn set-scroll-pos!
|
||||
[element scroll]
|
||||
(obj/set! ^js element "scrollTop" scroll))
|
||||
|
||||
(defn scroll-into-view!
|
||||
([element]
|
||||
(.scrollIntoView ^js element false))
|
||||
|
|
|
@ -763,7 +763,8 @@
|
|||
(assoc :delay (get-meta node :delay d/parse-double))
|
||||
|
||||
(cti/has-destination interaction)
|
||||
(assoc :destination (get-meta node :destination uuid/uuid))
|
||||
(assoc :destination (get-meta node :destination uuid/uuid)
|
||||
:preserve-scroll (get-meta node :preserve-scroll str->bool))
|
||||
|
||||
(cti/has-url interaction)
|
||||
(assoc :url (get-meta node :url str))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue