X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ce8d791a5298e0cb2569034aec4c8b57afac97b2..e194b9c8b1f7598814b77622768a10b56d7436a1:/redakcja/static/js/catalogue/catalogue.js diff --git a/redakcja/static/js/catalogue/catalogue.js b/redakcja/static/js/catalogue/catalogue.js index e8ef5e95..9d2bd958 100755 --- a/redakcja/static/js/catalogue/catalogue.js +++ b/redakcja/static/js/catalogue/catalogue.js @@ -2,28 +2,31 @@ $(function() { - $(function() { - $('.filter').change(function() { - document.filter[this.name].value = this.value; - document.filter.submit(); - }); + $('.filter').change(function() { + document.filter[this.name].value = this.value; + document.filter.submit(); + }); + + $('.check-filter').change(function() { + document.filter[this.name].value = this.checked ? '1' : ''; + document.filter.submit(); + }); - $('.check-filter').change(function() { - document.filter[this.name].value = this.checked ? '1' : ''; + $('.text-filter').each(function() { + var inp = this; + $(inp).parent().submit(function() { + document.filter[inp.name].value = inp.value; document.filter.submit(); + return false; }); + }); - $('.text-filter').each(function() { - var inp = this; - $(inp).parent().submit(function() { - document.filter[inp.name].value = inp.value; - document.filter.submit(); - return false; - }); - }); + + $('.autoslug-source').change(function() { + $('.autoslug').attr('value', slugify(this.value)); }); }); -})(jQuery) +})(jQuery);