Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add support for minLength. #31

Closed
wants to merge 1 commit into from

2 participants

@panozzaj

No description provided.

@aehlke
Owner

Thanks, but this is a better solution: #49 I'm waiting on my proposed change and then I'll pull that one.

@aehlke
Owner

Closing it in favor of #49

@aehlke aehlke closed this
@panozzaj

Sounds good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 9, 2011
  1. @panozzaj

    Add support for minLength.

    panozzaj authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 5 deletions.
  1. +0 −2  TODO
  2. +7 −3 js/tag-it.js
View
2  TODO
@@ -3,8 +3,6 @@ current one is deprecated, though still functional.
* Add keyboard shortcuts for highlighting tags to remove them upon backspace.
-* minLength for autocomplete
-
* hide the singleFieldNode
* add quotesAllowed option (or quotedSpacesAllowed)
View
10 js/tag-it.js
@@ -35,7 +35,10 @@
removeConfirmation: false,
caseSensitive : true,
- // When enabled, quotes are not neccesary
+ // jQuery UI autocomplete field pass-through
+ minLength : 0,
+
+ // When enabled, quotes are not necessary
// for inputting multi-word tags.
allowSpaces: false,
@@ -207,12 +210,13 @@
// Create a tag when the element loses focus (unless it's empty).
that.createTag(that._cleanedInput());
});
-
+
// Autocomplete.
if (this.options.availableTags || this.options.tagSource) {
this._tagInput.autocomplete({
source: this.options.tagSource,
+ minLength: this.options.minLength,
select: function(event, ui) {
// Delete the last tag if we autocomplete something despite the input being empty
// This happens because the input's blur event causes the tag to be created when
@@ -347,7 +351,7 @@
// insert tag
this._tagInput.parent().before(tag);
},
-
+
removeTag: function(tag, animate) {
animate = animate || this.options.animate;
Something went wrong with that request. Please try again.