Skip to content

Instantly share code, notes, and snippets.

@aurimasniekis
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurimasniekis/f91eb19ba84ecc6eebd1 to your computer and use it in GitHub Desktop.
Save aurimasniekis/f91eb19ba84ecc6eebd1 to your computer and use it in GitHub Desktop.
$(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