|
@@ -103,6 +103,20 @@
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Splits the string into an array of values, trimming each value. An empty array is returned for nulls or empty
|
|
|
|
+ * strings
|
|
|
|
+ * @param string
|
|
|
|
+ * @param separator
|
|
|
|
+ */
|
|
|
|
+ function splitVal(string, separator) {
|
|
|
|
+ var val, i, l;
|
|
|
|
+ if (string === null || string.length < 1) return [];
|
|
|
|
+ val = string.split(separator);
|
|
|
|
+ for (i = 0, l = val.length; i < l; i = i + 1) val[i] = $.trim(val[i]);
|
|
|
|
+ return val;
|
|
|
|
+ }
|
|
|
|
+
|
|
function getSideBorderPadding(element) {
|
|
function getSideBorderPadding(element) {
|
|
return element.outerWidth() - element.width();
|
|
return element.outerWidth() - element.width();
|
|
}
|
|
}
|
|
@@ -300,7 +314,6 @@
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Creates a new class
|
|
* Creates a new class
|
|
*
|
|
*
|
|
@@ -472,11 +485,11 @@
|
|
opts.createSearchChoice = function (term) { return {id: term, text: term};}
|
|
opts.createSearchChoice = function (term) { return {id: term, text: term};}
|
|
opts.initSelection = function (element) {
|
|
opts.initSelection = function (element) {
|
|
var data = [];
|
|
var data = [];
|
|
- $(element.val().split(",")).each(function () {
|
|
|
|
|
|
+ $(splitVal(element.val(), ",")).each(function () {
|
|
data.push({id: this, text: this});
|
|
data.push({id: this, text: this});
|
|
});
|
|
});
|
|
return data;
|
|
return data;
|
|
- }
|
|
|
|
|
|
+ };
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1309,13 +1322,13 @@
|
|
},
|
|
},
|
|
|
|
|
|
getVal: function () {
|
|
getVal: function () {
|
|
- var val;
|
|
|
|
|
|
+ var val, i, l;
|
|
if (this.select) {
|
|
if (this.select) {
|
|
val = this.select.val();
|
|
val = this.select.val();
|
|
return val === null ? [] : val;
|
|
return val === null ? [] : val;
|
|
} else {
|
|
} else {
|
|
val = this.opts.element.val();
|
|
val = this.opts.element.val();
|
|
- return (val === null || val === "") ? [] : val.split(",");
|
|
|
|
|
|
+ return splitVal(val, ",");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|