From ca2cf48cfde9cb060f9e96e3cb4c96258959727c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 27 2016 12:03:01 +0000 Subject: Fix highlighting lines when there are more than 10 files in the PR --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 25720e6..cd5a167 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -824,8 +824,8 @@ function updateHighlight(onload) { $('[href="#request_diff"]').addClass('active'); $('[href="#comments"]').removeClass('active'); } - var file = location.hash.substr(2).split(',')[0]; - var lines = location.hash.substr(4).split('-').map(function (x) { return parseInt(x, 10) }); + var file = parseInt(location.hash.substr(2).split(',')[0], 10); + var lines = location.hash.split(',')[1].split('-').map(function (x) { return parseInt(x, 10) }); for (var i = lines[lines.length - 1]; i >= lines[0]; i--) { $('#' + file + '_' + i).closest('tr').addClass(cls); }