|
776 | 776 | var self = this;
|
777 | 777 |
|
778 | 778 | var checkbox = $(el).parents(".filter-content").find("input:first");
|
779 |
| - var filter = checkbox.data("griddly-filter"); |
780 | 779 |
|
781 |
| - var selector = ".dropdown-menu li" + (!filter.data("griddly-filter-ismultiple") ? ":not(.griddly-list-group-header)" : ""); |
782 |
| - |
783 |
| - $(el).click(function () |
| 780 | + if (checkbox.length) |
784 | 781 | {
|
785 |
| - $(this).parents(".filter-content").find(selector).addClass("griddly-filter-selected"); |
786 |
| - $(this).parents(".filter-content").find("input").prop("checked", true).first().change(); |
787 |
| - }); |
| 782 | + var filter = checkbox.data("griddly-filter"); |
| 783 | + |
| 784 | + var selector = ".dropdown-menu li" + (!filter.data("griddly-filter-ismultiple") ? ":not(.griddly-list-group-header)" : ""); |
| 785 | + |
| 786 | + $(el).click(function () |
| 787 | + { |
| 788 | + $(this).parents(".filter-content").find(selector).addClass("griddly-filter-selected"); |
| 789 | + $(this).parents(".filter-content").find("input").prop("checked", true).first().change(); |
| 790 | + }); |
| 791 | + } |
788 | 792 | }, this));
|
789 | 793 |
|
790 | 794 | $(".griddly-filters-inline .filter-content .griddly-clear", this.$element).each($.proxy(function (i, el)
|
791 | 795 | {
|
792 | 796 | var self = this;
|
793 | 797 |
|
794 | 798 | var checkbox = $(el).parents(".filter-content").find("input:first");
|
795 |
| - var filter = checkbox.data("griddly-filter"); |
796 | 799 |
|
797 |
| - var selector = ".dropdown-menu li" + (!filter.data("griddly-filter-ismultiple") ? ":not(.griddly-list-group-header)" : ""); |
798 |
| - |
799 |
| - $(el).click(function () |
| 800 | + if (checkbox.length) |
800 | 801 | {
|
801 |
| - $(this).parents(".filter-content").find(selector).removeClass("griddly-filter-selected"); |
802 |
| - $(this).parents(".filter-content").find("input").prop("checked", false).first().change(); |
803 |
| - }); |
| 802 | + var filter = checkbox.data("griddly-filter"); |
| 803 | + |
| 804 | + var selector = ".dropdown-menu li" + (!filter.data("griddly-filter-ismultiple") ? ":not(.griddly-list-group-header)" : ""); |
| 805 | + |
| 806 | + $(el).click(function () |
| 807 | + { |
| 808 | + $(this).parents(".filter-content").find(selector).removeClass("griddly-filter-selected"); |
| 809 | + $(this).parents(".filter-content").find("input").prop("checked", false).first().change(); |
| 810 | + }); |
| 811 | + } |
804 | 812 | }, this));
|
805 | 813 | },
|
806 | 814 |
|
|
0 commit comments