diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index b676522fba..fb9eecba8d 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -114,4 +114,22 @@ $(function () { }); stabilityToggle.prop('checked', search === '?stableonly=true'); unstable.toggleClass('hidden', stabilityToggle[0].checked); + + + // Highlighting current anchor + + var anchors = $('.anchor'); + var _onHashChange = function () { + var activeHash = window.document.location.hash + .replace(/\./g, '\\.'); // Escape dot in element id + + anchors.removeClass('highlighted'); + + if (activeHash.length > 0) { + anchors.filter(activeHash).addClass('highlighted'); + } + }; + + $(window).on('hashchange', _onHashChange); + _onHashChange(); }); diff --git a/config/jsdoc/api/template/static/styles/jaguar.css b/config/jsdoc/api/template/static/styles/jaguar.css index ca9f4c1ce7..032c60d26d 100644 --- a/config/jsdoc/api/template/static/styles/jaguar.css +++ b/config/jsdoc/api/template/static/styles/jaguar.css @@ -51,6 +51,9 @@ body { width: 0px; height: 0px; } +.nameContainer .anchor.highlighted + h4 { + background-color: #faebcc; +} a { position: relative; z-index: 1;