Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function collapse(){
- $('#filter-form [type="checkbox"]').each(function() {
- if ($(this).prop('checked')) {
- $(this).closest('#filter-block').addClass('active');
- }
- });
- }
- $(document).on('pjax:success', function(e) {
- collapse();
- });
- $('body').on('click', '#filter-title' , function(){
- $(this).parent().toggleClass('active');
- $(this).parent().siblings().removeClass('active');
- });
- $('body').on('change', '.checkbox__filter', function (e) {
- $(this).closest('form').submit();
- $(this).closest('#filter-block').addClass('active');
- });
- var $set = $('#filter-title'),
- n=$set.index(this);
- $("input[name=index]").val(n);
- var eq = $("input[name=switch]").val();
- $('#filter-title:eq('+eq+')').parent().addClass("active");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement