From a9321f8fa9adad431357898755b61b114cdd6212 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Feb 21 2018 17:38:09 +0000 Subject: Switch to comments on PR page when url fragment is reset This can be manual action or by using Back button in browser. Fixes: https://pagure.io/pagure/issue/2722 --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 50d3cba..c01e751 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -1302,6 +1302,9 @@ function updateHighlight(onload) { var cls = "highlighted-line"; $('.' + cls).removeClass(cls) if (location.hash === '') { + // Display comments when the hash is removed. + $('#pr-tabs .nav-item a.nav-link, #pr-wrapper .tab-pane').removeClass('active'); + $('#comments, [href="#comments"]').addClass('active'); return } if (location.hash.indexOf("comment-") > -1) {