Disable buttons when no minor authors exist (#28).

This commit is contained in:
Adam Waldenberg 2015-11-14 09:00:14 +01:00
parent 937ac44e8a
commit cb72710ed0
3 changed files with 4 additions and 2 deletions

View File

@ -67,6 +67,8 @@
$("table#changes, table#blame").parent().find("button").filter(function() {{
this.hiddenCount = $(this).parent().find("tbody tr:hidden").length;
return this.hiddenCount > 0;
}}).each(function() {{
$(this).prop("disabled", false);
}}).click(function() {{
this.clicked = !this.clicked;

View File

@ -43,7 +43,7 @@ class BlameOutput(Outputable):
blame_xml = "<div><div class=\"box\">"
blame_xml += "<h1>" + _(BLAME_INFO_TEXT) + "</h1><hr /><div>"
blame_xml += "<button type=\"button\" class=\"btn btn-primary\""
blame_xml += " data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">"
blame_xml += " data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\" disabled>"
blame_xml += " <span>&#x2713;</span> " + _("Show minor authors")
blame_xml += "</button>"
blame_xml += "<table id=\"blame\" class=\"table table-striped\">"

View File

@ -46,7 +46,7 @@ class ChangesOutput(Outputable):
if authorinfo_list:
changes_xml += "<h1>" + _(HISTORICAL_INFO_TEXT) + "</h1><hr /><div>"
changes_xml += "<button type=\"button\" class=\"btn btn-primary\""
changes_xml += " data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">"
changes_xml += " data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\" disabled>"
changes_xml += " <span>&#x2713;</span> " + _("Show minor authors")
changes_xml += "</button>"
changes_xml += "<table id=\"changes\" class=\"table table-striped\">"