mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-21 09:20:08 -05:00
fix: scroll to top of panel on pagination click
Instead of the body. Added a slight offset to counteract the sticky navbar.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
@php
|
||||
if (! isset($scrollTo)) {
|
||||
$scrollTo = 'body';
|
||||
$scrollTo = '.panelV2';
|
||||
}
|
||||
|
||||
$scrollIntoViewJsSnippet =
|
||||
$scrollTo !== false
|
||||
? <<<JS
|
||||
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView()
|
||||
window.scroll({ top: ((\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).offsetTop - 80)})
|
||||
JS
|
||||
: '';
|
||||
@endphp
|
||||
|
||||
Reference in New Issue
Block a user