Update: Change UI for "Show Closed Jobs"

Move to a button at the bottom of the list.
This commit is contained in:
Gary Sharp
2014-02-06 18:57:10 +11:00
parent 6d54f3f972
commit 2e7b66ee5b
15 changed files with 63 additions and 88 deletions
@@ -55,14 +55,20 @@
wrapperPrev = null;
}
var showClosedAnchor = $('<a class="dataTables_showStatusClosed" href="#">').text('Show Closed (' + $closedJobs.length + ')');
wrapper.prepend(showClosedAnchor);
var allClosedContainer = wrapperContext.find('div.allClosed_container');
if (allClosedContainer.length > 0) {
$table.hide();
wrapper.find('.dataTables_filter').hide();
} else {
$('<a class="dataTables_showStatusClosed button small" href="#">').text('Show Closed Jobs (' + $closedJobs.length + ')').appendTo(wrapperContext);
}
wrapperContext.on('click', 'a.dataTables_showStatusClosed', function () {
$table.show();
wrapper.find('.dataTables_filter').show();
$table.removeClass('hideStatusClosed');
allClosedContainer.remove();
showClosedAnchor.remove();
$(this).remove();
if (wrapperPrev)
wrapperPrev.html(wrapperPrev.data('dataTable_originalContent'));
@@ -70,18 +76,9 @@
return false;
});
var allClosedContainer = wrapperContext.find('div.allClosed_container');
if (allClosedContainer.length > 0) {
$table.hide();
wrapper.find('.dataTables_filter').hide();
showClosedAnchor.css('right', '4px')
}
}
}
dataTables.push(this);
});