mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-14 18:47:32 +01:00
fix: #13919
This commit is contained in:
@@ -25,10 +25,13 @@ define('admin/settings', [
|
|||||||
});
|
});
|
||||||
const offset = mainHader.outerHeight(true);
|
const offset = mainHader.outerHeight(true);
|
||||||
// https://stackoverflow.com/a/11814275/583363
|
// https://stackoverflow.com/a/11814275/583363
|
||||||
tocList.find('a').on('click', function (event) {
|
tocList.find('a').on('click', function () {
|
||||||
event.preventDefault();
|
|
||||||
const href = $(this).attr('href');
|
const href = $(this).attr('href');
|
||||||
$(href)[0].scrollIntoView();
|
const $target = $(href);
|
||||||
|
if (!$target.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$target.get(0).scrollIntoView(true);
|
||||||
window.location.hash = href;
|
window.location.hash = href;
|
||||||
scrollBy(0, -offset);
|
scrollBy(0, -offset);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user