Permalink
Browse files

Add tag value preprocessing option

  • Loading branch information...
kevinslin committed Feb 23, 2013
1 parent 2c65818 commit 8a0f47aeeccae57b427eb98d458fcae0dc349c4a
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

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 8a0f47a

Please sign in to comment.