mirror of
https://github.com/Erreur32/html5demos.git
synced 2024-09-30 04:01:32 +02:00
JS filtering was hiding the thead
This commit is contained in:
parent
4a3679135e
commit
40ef445651
@ -82,7 +82,7 @@ function spans($list) {
|
|||||||
|
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$('tr span').click(function () {
|
$('tbody tr span').click(function () {
|
||||||
var $tag = $(this), tag = $tag.text(), type = $tag.closest('td').attr('class');
|
var $tag = $(this), tag = $tag.text(), type = $tag.closest('td').attr('class');
|
||||||
if ($tag.is('.selected')) {
|
if ($tag.is('.selected')) {
|
||||||
$('.' + type + ' span:contains(' + tag + ')').removeClass('selected');
|
$('.' + type + ' span:contains(' + tag + ')').removeClass('selected');
|
||||||
@ -93,10 +93,10 @@ $('tr span').click(function () {
|
|||||||
// it's an AND filter
|
// it's an AND filter
|
||||||
var $trs = $('.' + type + ':has(span.selected)').closest('tr');
|
var $trs = $('.' + type + ':has(span.selected)').closest('tr');
|
||||||
if ($trs.length) {
|
if ($trs.length) {
|
||||||
$('tr').hide();
|
$('tbody tr').hide();
|
||||||
$trs.show();
|
$trs.show();
|
||||||
} else {
|
} else {
|
||||||
$('tr').show();
|
$('tbody tr').show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user