Commit 31521a01 authored by Mike Griffin's avatar Mike Griffin

Update bootstrap-multiselect.js

parent eec0b51e
......@@ -19,6 +19,13 @@
var selectOptions = allBindingsAccessor().options;
var ms = $(element).data('multiselect');
// If the ko.observableArray changes rebuild the multiselect
if (isObservableArray(selectOptions)) {
selectOptions.subscribe(function (theArray) {
$(element).multiselect('rebuild');
});
}
if (!ms) {
$(element).multiselect(config);
}
......@@ -32,6 +39,10 @@
};
}
function isObservableArray(obj) {
return ko.isObservable(obj) && !(obj.destroyAll === undefined);
};
/**
* Constructor to create a new multiselect using the given select.
*
......
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