Commit 1d17e957 authored by David Stutz's avatar David Stutz

Started tests for filter.

parent 06549a01
...@@ -199,6 +199,7 @@ ...@@ -199,6 +199,7 @@
this.options.onDropdownShown = $.proxy(this.options.onDropdownShown, this); this.options.onDropdownShown = $.proxy(this.options.onDropdownShown, this);
this.options.onDropdownHidden = $.proxy(this.options.onDropdownHidden, this); this.options.onDropdownHidden = $.proxy(this.options.onDropdownHidden, this);
this.options.onInitialized = $.proxy(this.options.onInitialized, this); this.options.onInitialized = $.proxy(this.options.onInitialized, this);
this.options.onFiltering = $.proxy(this.options.onFiltering, this);
// Build select all if enabled. // Build select all if enabled.
this.buildContainer(); this.buildContainer();
...@@ -377,6 +378,14 @@ ...@@ -377,6 +378,14 @@
*/ */
onInitialized: function($select, $container) { onInitialized: function($select, $container) {
},
/**
* Triggered on filtering.
*
* @param {jQuery} $filter
*/
onFiltering: function($filter) {
}, },
enableHTML: false, enableHTML: false,
buttonClass: 'btn btn-default', buttonClass: 'btn btn-default',
...@@ -796,7 +805,7 @@ ...@@ -796,7 +805,7 @@
var visible = true; var visible = true;
$inputs.each(function() { $inputs.each(function() {
visible = visible && !$(this).hasClass('multiselect-collapsible-hidden'); visible = visible && $(this).is(':visible');
}); });
if (visible) { if (visible) {
...@@ -1023,7 +1032,7 @@ ...@@ -1023,7 +1032,7 @@
// Cancel enter key default behaviour // Cancel enter key default behaviour
if (event.which === 13) { if (event.which === 13) {
event.preventDefault(); event.preventDefault();
} }
// This is useful to catch "keydown" events after the browser has updated the control. // This is useful to catch "keydown" events after the browser has updated the control.
clearTimeout(this.searchTimeout); clearTimeout(this.searchTimeout);
...@@ -1102,6 +1111,9 @@ ...@@ -1102,6 +1111,9 @@
if (this.options.enableClickableOptGroups && this.options.multiple) { if (this.options.enableClickableOptGroups && this.options.multiple) {
this.updateOptGroups(); this.updateOptGroups();
} }
this.options.onFiltering(event.target);
}, this), 300, this); }, this), 300, this);
}, this)); }, this));
} }
...@@ -1371,9 +1383,8 @@ ...@@ -1371,9 +1383,8 @@
if (this.options.enableClickableOptGroups && this.options.multiple) { if (this.options.enableClickableOptGroups && this.options.multiple) {
this.updateOptGroups(); this.updateOptGroups();
} }
console.log('test')
if (triggerOnDeselectAll) { if (triggerOnDeselectAll) {
console.log('test2')
this.options.onDeselectAll(); this.options.onDeselectAll();
} }
}, },
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment