From 98641f0bb9117c4c89fe5d214b6c8ddba5f37c9e Mon Sep 17 00:00:00 2001 From: Takuya Aramaki Date: Fri, 29 Nov 2024 19:28:14 +0900 Subject: [PATCH] Fix parameter link scrolling to the correct position (#1171) --- js/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/common.js b/js/common.js index cea565982e..a81da820bb 100644 --- a/js/common.js +++ b/js/common.js @@ -368,7 +368,7 @@ $(document).ready(function () { function findParameter(elt) { var id = $(elt).text().replace(/^&?(\.\.\.)?\$?/g, ''); return $('.parameters, .options').find('.parameter').filter(function () { - return $(elt).text().trim() === id; // https://bugs.php.net/bug.php?id=74493 + return $(this).text().trim() === id; // https://bugs.php.net/bug.php?id=74493 }).first(); } @@ -383,7 +383,7 @@ $(document).ready(function () { var param = findParameter(this); if (param.length) { $.scrollTo({ - top: param.offset().top - 52, + top: param.offset().top, left: 0 }, 400); }