This commit is contained in:
Barış Soner Uşaklı
2026-01-23 12:34:59 -05:00
parent 090b9f55bc
commit b2c6fbeddb

View File

@@ -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(() => {