Commit 64ca843f authored by David Stutz's avatar David Stutz

#351.

parent 842149b0
...@@ -10,15 +10,6 @@ ...@@ -10,15 +10,6 @@
"use strict";// jshint ;_; "use strict";// jshint ;_;
if (Array.prototype.forEach === null || Array.prototype.forEach === undefined) {
Array.prototype.forEach = function (func) {
var index;
for (index = 0; index < this.length; ++index) {
func(this[index]);
}
};
}
if (typeof ko !== 'undefined' && ko.bindingHandlers && !ko.bindingHandlers.multiselect) { if (typeof ko !== 'undefined' && ko.bindingHandlers && !ko.bindingHandlers.multiselect) {
ko.bindingHandlers.multiselect = { ko.bindingHandlers.multiselect = {
...@@ -35,7 +26,7 @@ ...@@ -35,7 +26,7 @@
// Subscribe to the selectedOptions: ko.observableArray // Subscribe to the selectedOptions: ko.observableArray
listOfSelectedItems.subscribe(function (changes) { listOfSelectedItems.subscribe(function (changes) {
var addedArray = [], deletedArray = []; var addedArray = [], deletedArray = [];
changes.forEach(function (change) { forEach(changes, function (change) {
switch (change.status) { switch (change.status) {
case 'added': case 'added':
addedArray.push(change.value); addedArray.push(change.value);
...@@ -82,6 +73,13 @@ ...@@ -82,6 +73,13 @@
return ko.isObservable(obj) && !(obj.destroyAll === undefined); return ko.isObservable(obj) && !(obj.destroyAll === undefined);
} }
function forEach(array, callback) {
var index;
for (index = 0; index < array.length; ++index) {
callback(array[index]);
}
}
/** /**
* Constructor to create a new multiselect using the given select. * Constructor to create a new multiselect using the given select.
* *
...@@ -941,7 +939,7 @@ ...@@ -941,7 +939,7 @@
groupCounter++; groupCounter++;
optionDOM += '<optgroup label="' + (option.title || 'Group ' + groupCounter) + '">'; optionDOM += '<optgroup label="' + (option.title || 'Group ' + groupCounter) + '">';
option.children.forEach(function(subOption) { forEach(option.children, function(subOption) {
optionDOM += '<option value="' + subOption.value + '">' + (subOption.label || subOption.value) + '</option>'; optionDOM += '<option value="' + subOption.value + '">' + (subOption.label || subOption.value) + '</option>';
}); });
......
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