|
346 | 346 | if (this.$select[0][0].value === this.options.selectAllValue) { |
347 | 347 |
|
348 | 348 | var values = []; |
349 | | - |
350 | | - // Check for visibility of options. |
351 | | - var options = $('option[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$select) |
352 | | - .filter(':visible'); |
| 349 | + var options = $('option[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$select); |
353 | 350 |
|
354 | 351 | for (var i = 0; i < options.length; i++) { |
355 | | - values.push(options[i].value); |
| 352 | + |
| 353 | + // Check whether this option is actually visible. |
| 354 | + if (this.getInputByValue(options[i].value) && this.getInputByValue(options[i].value).is(':visible')) { |
| 355 | + values.push(options[i].value); |
| 356 | + } |
356 | 357 | } |
357 | 358 |
|
358 | 359 | if (checked) { |
|
618 | 619 | var value = $('input', element).val(); |
619 | 620 | var text = $('label', element).text(); |
620 | 621 |
|
| 622 | + var filterCandidate = ''; |
| 623 | + if ((this.options.filterBehavior === 'text')) { |
| 624 | + filterCandidate = text; |
| 625 | + } |
| 626 | + else if ((this.options.filterBehavior === 'value')) { |
| 627 | + filterCandidate = value; |
| 628 | + } |
| 629 | + else if (this.options.filterBehavior === 'both') { |
| 630 | + filterCandidate = text + '\n' + value; |
| 631 | + } |
| 632 | + |
621 | 633 | if (value !== this.options.selectAllValue && text) { |
622 | 634 | // by default lets assume that element is not |
623 | 635 | // interesting for this search |
624 | 636 | var showElement = false; |
625 | 637 |
|
626 | | - var filterCandidate = ''; |
627 | | - if ((this.options.filterBehavior === 'text' || this.options.filterBehavior === 'both')) { |
628 | | - filterCandidate = text; |
629 | | - } |
630 | | - if ((this.options.filterBehavior === 'value' || this.options.filterBehavior === 'both')) { |
631 | | - filterCandidate = value; |
632 | | - } |
633 | | - |
634 | 638 | if (this.options.enableCaseInsensitiveFiltering && filterCandidate.toLowerCase().indexOf(this.query.toLowerCase()) > -1) { |
635 | 639 | showElement = true; |
636 | 640 | } |
|
920 | 924 |
|
921 | 925 | for (var i = 0; i < options.length; i = i + 1) { |
922 | 926 | var option = options[i]; |
923 | | - if (option.value == valueToCompare) { |
| 927 | + if (option.value === valueToCompare) { |
924 | 928 | return $(option); |
925 | 929 | } |
926 | 930 | } |
|
939 | 943 |
|
940 | 944 | for (var i = 0; i < checkboxes.length; i = i + 1) { |
941 | 945 | var checkbox = checkboxes[i]; |
942 | | - if (checkbox.value == valueToCompare) { |
| 946 | + if (checkbox.value === valueToCompare) { |
943 | 947 | return $(checkbox); |
944 | 948 | } |
945 | 949 | } |
|
0 commit comments