diff --git a/js/common.js b/js/common.js index 02076387e..052c34e74 100644 --- a/js/common.js +++ b/js/common.js @@ -368,16 +368,29 @@ $(document).ready(function () { $(this).append(" ΒΆ"); }); - $('.refentry code.parameter').click(function (event) { - var id = $(this).text().replace(/^&?(\.\.\.)?\$?/g, ''); - var offsetTop = $('.parameters, .options').find('.parameter').filter(function () { - return $(this).text().trim() === id; // https://bugs.php.net/bug.php?id=74493 - }).offset().top - 52; - $.scrollTo({ - top: offsetTop, - left: 0 - }, 400); - }); + 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 + }).first(); + } + + $('.refentry code.parameter') + .each(function () { + var param = findParameter(this); + if (param.length) { + $(this).css('cursor', 'pointer'); + } + }) + .click(function () { + var param = findParameter(this); + if (param.length) { + $.scrollTo({ + top: param.offset().top - 52, + left: 0 + }, 400); + } + }); $('h1[id], h2[id], h3[id], h4[id]').each(function () { var $this = $(this); diff --git a/styles/theme-base.css b/styles/theme-base.css index ae95208f2..756f4fbd3 100644 --- a/styles/theme-base.css +++ b/styles/theme-base.css @@ -1220,9 +1220,6 @@ header.title { /* {{{ General styles (p, parameters, initializers, ...) */ -.refsect1 .parameter { - cursor:pointer; -} .refsect1 dt { height:1.5rem; }