com web/php: Use exact word for parameter scroll #74493: js/common.js

From: Date: Tue, 25 Apr 2017 12:19:52 +0000
Subject: com web/php: Use exact word for parameter scroll #74493: js/common.js
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-26170@lists.php.net to get a copy of this message
Commit: 6cec58d94b1357b907389e4b5123de85176bf635 Author: JayPHP <JayPHP@users.noreply.github.com> Tue, 25 Apr 2017 13:19:52 +0100 Committer: GitHub <noreply@github.com> Tue, 25 Apr 2017 13:19:52 +0100 Parents: 3b52af0eea466ca2d5a906fa24659f901af0ba8d Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=6cec58d94b1357b907389e4b5123de85176bf635 Log: Use exact word for parameter scroll #74493 https://bugs.php.net/bug.php?id=74493 Bugs: https://bugs.php.net/74493 Changed paths: M js/common.js Diff: diff --git a/js/common.js b/js/common.js index 4617432..ef2a61e 100644 --- a/js/common.js +++ b/js/common.js @@ -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); });

« previous php.webmaster (#26170) next »