Permalink
Browse files

The tagSource option could just be a URL string (as jQueryUI's autoco…

…mplete accepts). Don't bind the callback in that case.
  • Loading branch information...
1 parent 453e113 commit 565a6e4b00649293c86785020ecdb1164eaee9dc @GUI committed Aug 18, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 js/tag-it.js
View
@@ -110,7 +110,11 @@
});
showChoices(this._subtractArray(choices, this.assignedTags()));
};
- this.options.tagSource = $.proxy(this.options.tagSource, this);
+
+ // Bind tagSource callback functions to this context.
+ if ($.isFunction(this.options.tagSource)) {
+ this.options.tagSource = $.proxy(this.options.tagSource, this);
+ }
this.tagList
.addClass('tagit')

0 comments on commit 565a6e4

Please sign in to comment.