diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 0c1db3a..3fc031b 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -26,7 +26,7 @@ {% endblock %} {% block repo %} -
+
{% if pull_request %}

PR#{{requestid}} @@ -1244,10 +1244,14 @@ function updateHighlight(onload) { highlight_comment(); } else { if (onload) { - $('#comments').removeClass('active'); - $('[href="#comments"]').removeClass('active'); - // When the hash points to 'Files Changed' tab. - if (location.hash.indexOf("request_diff") > -1) { + // Hide all tabs, and then show the one pointed to by the hash. + // This is neccessary to handle 'Back' button presses in the browser, + // which otherwise break the tabs view . + $('#pr-tabs .nav-item a.nav-link').removeClass('active'); + $('#pr-wrapper .tab-pane').removeClass('active'); + // When the hash points to 'Files Changed' tab, or a highlight. + if (location.hash.indexOf("request_diff") > -1 || + location.hash.indexOf("_") === 1) { $('[href="#request_diff"]').addClass('active'); $('#request_diff').addClass('active'); }