Skip to content

Commit cb788e0

Browse files
committed
HTML report : anchors
1 parent ecf1cb4 commit cb788e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

templates/html/summary/report.html.twig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@
206206
var ruleSet = {{ ruleSet.asArray() | json_encode }}
207207
{% endautoescape %}
208208
209+
// fixes links to tab
210+
// Javascript to enable link to tab
211+
var hash = document.location.hash;
212+
var prefix = "tab_";
213+
if (hash) {
214+
$('#menu a[href='+hash.replace(prefix,"")+']').tab('show');
215+
}
216+
// Change hash for page-reload
217+
$('#menu a').on('shown', function (e) {
218+
window.location.hash = e.target.hash.replace("#", "#" + prefix);
219+
});
220+
209221
</script>
210222

211223

0 commit comments

Comments
 (0)