Fix broken logic for showing/hiding jobsets

This commit is contained in:
Eelco Dolstra 2016-11-01 13:03:14 +01:00
parent ef711ce845
commit 9072adece8
3 changed files with 18 additions and 18 deletions

View file

@ -511,7 +511,7 @@ BLOCK renderJobsetOverview %]
<tbody>
[% FOREACH j IN jobsets %]
[% successrate = 0 %]
<tr class="[% IF j.hidden && !showHidden %] hidden-jobset [% END %] [% IF !j.enabled %] disabled-jobset [% END %]" >
<tr class="jobset [% IF j.hidden && !showHidden %] hidden-jobset [% END %] [% IF !j.enabled %] disabled-jobset [% END %]" >
<td>
[% IF j.get_column('nrscheduled') > 0 %]
<img src="[% c.uri_for("/static/images/help_16.png") %]" alt="Scheduled" />

View file

@ -27,22 +27,26 @@
<div class="tab-content">
<script type="text/javascript">
function showJobsets() {
var showHidden = $('#show-hidden').hasClass('active');
var showDisabled = $('#show-disabled').hasClass('active');
$('tr.jobset').map(function() {
var hide =
($(this).hasClass('hidden-jobset') && !showHidden) ||
($(this).hasClass('disabled-jobset') && !showDisabled);
if (hide) $(this).hide(); else $(this).show();
});
return false;
};
$(document).ready(function() {
$('#show-hidden').on('click', function (e) {
var show = !$(this).hasClass('active');
if (show)
$('tr.hidden-jobset').show();
else
$('tr.hidden-jobset').hide();
$('#show-hidden, #show-disabled').on('click', function(e) {
$(this).toggleClass('active');
showJobsets();
return false;
});
$('#show-disabled').on('click', function (e) {
var show = !$(this).hasClass('active');
if (show)
$('tr.disabled-jobset').show();
else
$('tr.disabled-jobset').hide();
});
showJobsets();
});
</script>

View file

@ -47,10 +47,6 @@ span.hidden-project a, span.hidden-jobset a {
color: gray;
}
tr.hidden-jobset {
display: none;
}
table.info-table th {
padding-right: 1.0em;
padding-bottom: 0.2em;