From 565a6e4b00649293c86785020ecdb1164eaee9dc Mon Sep 17 00:00:00 2001 From: Nick Muerdter Date: Wed, 17 Aug 2011 21:18:48 -0600 Subject: [PATCH] The tagSource option could just be a URL string (as jQueryUI's autocomplete accepts). Don't bind the callback in that case. --- js/tag-it.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/tag-it.js b/js/tag-it.js index fff12423..9f6e1f5a 100644 --- a/js/tag-it.js +++ b/js/tag-it.js @@ -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')