$(document).ready(function(){
$("#search").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
$("#category").on("change", function() {
var value = $(this).val().toLowerCase();
console.log("Change" , value);
$("#myTable tr").filter(function() {
var thisRow = $(this);
var hasCat = thisRow.attr('data-cat').toLowerCase() == value;
console.log(hasCat);
$(this).toggle(hasCat);
});
});
$("#conditionType").click(function(){
if ($("#conditionType").text()=="And") {
$("#conditionType").text("Or");
} else {
$("#conditionType").text("And");
}
});
$(".tag").click(function(){
if ($(this).hasClass("label-primary")){
$(this).addClass("label-default");
$(this).removeClass("label-primary");
} else {
$(this).removeClass("label-default");
$(this).addClass("label-primary");
}