mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 16:52:12 +08:00
Fix PostStream endless loading due to broken scroll anchor
This commit is contained in:
parent
f59e14db3e
commit
3e4b30695e
@ -12,11 +12,10 @@
|
||||
* @param {Function} callback The callback to run that will change page content.
|
||||
*/
|
||||
export default function anchorScroll(element, callback) {
|
||||
const $element = $(element);
|
||||
const $window = $(window);
|
||||
const relativeScroll = $element.offset().top - $window.scrollTop();
|
||||
const relativeScroll = $(element).offset().top - $window.scrollTop();
|
||||
|
||||
callback();
|
||||
|
||||
$window.scrollTop($element.offset().top - relativeScroll);
|
||||
$window.scrollTop($(element).offset().top - relativeScroll);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user