fixed filtering bug
This commit is contained in:
parent
587a2a3b2a
commit
6808cc517f
1 changed files with 13 additions and 16 deletions
|
@ -60,16 +60,6 @@ function capitaliseFirstLetter(string)
|
||||||
|
|
||||||
var category = $(this).children('img').attr('alt');
|
var category = $(this).children('img').attr('alt');
|
||||||
category = capitaliseFirstLetter(category);
|
category = capitaliseFirstLetter(category);
|
||||||
|
|
||||||
// toggle the image and the boolean array value
|
|
||||||
if (categoryVisible[category] == true) {
|
|
||||||
$(this).addClass('toggledOff');
|
|
||||||
categoryVisible[category] = false;
|
|
||||||
}
|
|
||||||
else if (categoryVisible[category] == false) {
|
|
||||||
$(this).removeClass('toggledOff');
|
|
||||||
categoryVisible[category] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// this means that we are on a map view
|
// this means that we are on a map view
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
|
@ -83,15 +73,22 @@ function capitaliseFirstLetter(string)
|
||||||
// this means that we are on a card view
|
// this means that we are on a card view
|
||||||
else {
|
else {
|
||||||
console.log('test');
|
console.log('test');
|
||||||
if (categoryVisible[category] == false) {
|
if (categoryVisible[category] == true) {
|
||||||
$('#cards .' + category).fadeOut('fast');
|
$('#cards .' + category).fadeOut('fast');
|
||||||
console.log('#cards .' + category);
|
|
||||||
}
|
}
|
||||||
else if (categoryVisible[category] == true) {
|
else if (categoryVisible[category] == false) {
|
||||||
$('#cards .' + category).fadeOut('fast');
|
$('#cards .' + category).fadeIn('fast');
|
||||||
console.log('#cards .' + category);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// toggle the image and the boolean array value
|
||||||
|
if (categoryVisible[category] == true) {
|
||||||
|
$(this).addClass('toggledOff');
|
||||||
|
categoryVisible[category] = false;
|
||||||
|
}
|
||||||
|
else if (categoryVisible[category] == false) {
|
||||||
|
$(this).removeClass('toggledOff');
|
||||||
|
categoryVisible[category] = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue