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

Update bootstrap-multiselect.js

parent eec0b51e
......@@ -18,6 +18,13 @@
var config = ko.utils.unwrapObservable(valueAccessor());
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);
......@@ -31,6 +38,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