Permalink
Browse files

Merge pull request #150 from kevinslin/master

Add option to preprocessTags before creatingTag
  • Loading branch information...
2 parents 6da7950 + 8a0f47a commit 63f7c1189b223a0edcba407aee7420e975824a97 @aehlke committed Mar 4, 2013
Showing with 7 additions and 17 deletions.
  1. +6 −2 js/tag-it.js
  2. +1 −15 js/tag-it.min.js
View
@@ -60,7 +60,7 @@
//
// The easiest way to use singleField is to just instantiate tag-it
// on an INPUT element, in which case singleField is automatically
- // set to true, and singleFieldNode is set to that element. This
+ // set to true, and singleFieldNode is set to that element. This
// way, you don't need to fiddle with these options.
singleField: false,
@@ -235,7 +235,7 @@
// Comma/Space/Enter are all valid delimiters for new tags,
// except when there is an open quote or if setting allowSpaces = true.
- // Tab will also create a tag, unless the tag input is empty,
+ // Tab will also create a tag, unless the tag input is empty,
// in which case it isn't caught.
if (
event.which === $.ui.keyCode.COMMA ||
@@ -389,6 +389,10 @@
value = $.trim(value);
+ if(this.options.preprocessTag) {
+ value = this.options.preprocessTag(value);
+ }
+
if (value === '') {
return false;
}
View
Oops, something went wrong.

0 comments on commit 63f7c11

Please sign in to comment.