Last active
August 29, 2015 14:07
-
-
Save aurimasniekis/f91eb19ba84ecc6eebd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var toggleVisible = function(div, label) { | |
if (div.is(':visible')) { | |
$.removeCookie('hiddenFilter'); | |
div.hide(); | |
} else { | |
$.cookie('hiddenFilter', 1); | |
div.show(); | |
} | |
label.text(function(i, text) { | |
if (text === "Less") { | |
return "More"; | |
} else { | |
return "Less"; | |
} | |
}); | |
}; | |
var orderFilterShow = $("#order-filter-show"); | |
toggleVisible(additionalFiltersOrder, orderFilterShow); | |
orderFilterShow.click(function() { toggleVisible($("div.additional-filters-order"), $(this)); }); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment