From 215347c9459268c35c70d07b66ab8d4a985815ea Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 09 2015 11:56:07 +0000 Subject: Set the title of the tab as URL hash to allow directly linking to it --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 67aaabc..a8f6d6b 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -352,7 +352,14 @@ } ); - $( ".tabs" ).tabs(); + $( ".tabs" ).tabs({ + activate: function( event, ui ) { + var _title = ui.newPanel.attr('id'); + if ($.inArray( _title, [ "request_diff", "commit_list" ] ) >= 0) { + window.location.hash = _title; + } + } + }); {% if pull_request %} {# These lines are only for existing pull-requests, not new ones #}