Browse files

Fixes

  • Loading branch information...
1 parent 61f51a9 commit acbd8650b0dda57531de5b12e6a7b1ff40a134cc Mark Gibson committed Dec 11, 2009
Showing with 9 additions and 4 deletions.
  1. +8 −3 src/jquery.ui.tokenlist.js
  2. +1 −1 version.txt
View
11 src/jquery.ui.tokenlist.js
@@ -14,6 +14,10 @@ $.widget('ui.tokenlist', {
_init: function() {
var self = this, key = $.ui.keyCode;
+ if ( !this.options.items ) {
+ this.options.items = [];
+ }
+
if (this.element.is(':text')) {
this.textElem = this.element;
@@ -191,7 +195,7 @@ $.widget('ui.tokenlist', {
if ($.isArray(validate)) {
if ($.inArray(item, validate) < 0) { return; }
} else if ($.isFunction(validate)) {
- if (!validate.apply(self, item)) { return; }
+ if (!validate.call(self, item)) { return; }
}
}
@@ -250,7 +254,9 @@ $.widget('ui.tokenlist', {
_change: function() {
if (this.textElem) {
- this.textElem.val(this._stringify(this.items()));
+ this.textElem
+ .val(this._stringify(this.items()))
+ .trigger('change');
}
this.element.trigger('change');
}
@@ -265,7 +271,6 @@ $.extend($.ui.tokenlist, {
join: ', ',
removeTip: "Remove Item",
duplicates: false,
- items: [],
validate: false // Maybe false, an array of allowed values, or a validation function
}
});
View
2 version.txt
@@ -1 +1 @@
-0.1
+0.2

0 comments on commit acbd865

Please sign in to comment.