diff --git a/gitinspector/html/html.header b/gitinspector/html/html.header index 922e049..7733915 100644 --- a/gitinspector/html/html.header +++ b/gitinspector/html/html.header @@ -16,17 +16,6 @@ var MINOR_AUTHOR_PERCENTAGE = 1.00; var isReversed = false; - var colorRows = function() {{ - $(this).removeClass("odd"); - - if (row++ % 2 == 1) {{ - $(this).addClass("odd"); - }} - - if(this == $(this).parent().find("tr:visible").get(-1)) {{ - row = 0; - }} - }} // Fix header and set it to the right width. var remainingHeaderWidth = ($("div.logo").width() - 4) - ($("div.logo img").innerWidth() + 48) @@ -46,25 +35,23 @@ }}).hide(); }} - $("table#changes tbody tr td:last-child").filter(function() {{ - return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE; - }}).parent().hide(); - - $("table#blame tbody tr td:last-child").filter(function() {{ - return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE; - }}).parent().hide(); - - $("table.git tbody tr:visible").each(colorRows); - $("table#changes, table#blame").tablesorter({{ sortList: [[0,0]], headers: {{ 0: {{ sorter: "text" }} }} - }}).bind("sortEnd", function() {{ - $(this).find("tbody tr:visible").each(colorRows); }}); + $("table#changes tbody tr td:last-child").filter(function() {{ + return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE; + }}).parent().each(function() {{ + $(this).after("").hide(); + }}).hide(); + + $("table#blame tbody tr td:last-child").filter(function() {{ + return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE; + }}).parent().hide(); + $("table#changes thead tr th, table#blame thead tr th").click(function() {{ $(this).parent().find("th strong").remove(); var parentIndex = $(this).index(); @@ -82,7 +69,7 @@ $(this).append(""); }}); - $("table.git tfoot tr td:first-child").filter(function() {{ + $("table#changes tfoot tr td:first-child").filter(function() {{ this.hiddenCount = $(this).parent().parent().parent().find("tbody tr:hidden").length; return this.hiddenCount > 0; }}).each(function() {{ @@ -93,20 +80,21 @@ if (this.clicked) {{ this.innerHTML = "{hide_minor_authors} (" + this.hiddenCount + ") ∧"; - $(this).parent().parent().parent().find("tbody tr").show().each(colorRows); + $(this).parent().parent().parent().find("tbody tr:empty").remove(); + $(this).parent().parent().parent().find("tbody tr").show(); }} else {{ this.innerHTML = "{show_minor_authors} (" + this.hiddenCount + ") ∨"; $(this).parent().parent().parent().find("tbody tr td:last-child").filter(function() {{ return parseFloat(this.innerHTML) < MINOR_AUTHOR_PERCENTAGE; - }}).parent().hide(); - $("table.git tbody tr:visible").each(colorRows); + }}).parent().each(function() {{ + $(this).after("").hide(); + }}).hide(); }} }}); filterResponsibilities(); var hiddenResponsibilitiesCount = $("div#responsibilities div h3:hidden").length; if (hiddenResponsibilitiesCount > 0) {{ - $("div#responsibilities div h3:visible").each(colorRows); $("div#responsibilities").prepend("
{show_minor_authors} (" + hiddenResponsibilitiesCount + ") ∨
"); $("div#responsibilities div.button").click(function() {{ @@ -125,7 +113,6 @@ filterTimeLine(); var hiddenTimelineCount = $("div#timeline table.git tbody tr:hidden").length; if (hiddenTimelineCount > 0) {{ - $("div#timeline table.git tbody tr:visible").each(colorRows); $("div#timeline").prepend("
{show_minor_rows} (" + hiddenTimelineCount + ") ∨
"); $("div#timeline div.button").click(function() {{ @@ -136,7 +123,6 @@ }} else {{ this.innerHTML = "{show_minor_rows} (" + hiddenTimelineCount + ") ∨"; filterTimeLine(); - $("div#timeline table.git tbody tr:visible").each(colorRows); }} }}); }} @@ -208,39 +194,68 @@ -