1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Use exact word for parameter scroll #74493

https://bugs.php.net/bug.php?id=74493
This commit is contained in:
JayPHP
2017-04-25 13:19:52 +01:00
committed by GitHub
parent 3b52af0eea
commit 6cec58d94b

View File

@@ -407,9 +407,9 @@ $(document).ready(function() {
$('.refentry code.parameter').click(function(event)
{
var id = $(this).text().replace(/^[&$]{0,2}/g, '');
var offsetTop = $(
'.parameters .parameter:contains("' + id + '"), .options .parameter:contains("' + id + '")'
).offset().top - 52;
var offsetTop = $('.parameters, .options').find('.parameter').filter(function() {
return $(this).text() === id;
}).offset().top - 52;
$.scrollTo({top: offsetTop, left: 0}, 400);
});