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> <tbody>
[% FOREACH j IN jobsets %] [% FOREACH j IN jobsets %]
[% successrate = 0 %] [% 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> <td>
[% IF j.get_column('nrscheduled') > 0 %] [% IF j.get_column('nrscheduled') > 0 %]
<img src="[% c.uri_for("/static/images/help_16.png") %]" alt="Scheduled" /> <img src="[% c.uri_for("/static/images/help_16.png") %]" alt="Scheduled" />

View file

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

View file

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