Skip to content
Browse files

Don't add tokens if limit has been reached.

  • Loading branch information...
1 parent 3c115b1 commit 32f2f35cfc5fbcf5ab382e4e3eca1952b0705859 Georg Schmidl committed Jul 8, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/jquery.tokeninput.js
View
6 src/jquery.tokeninput.js
@@ -470,8 +470,10 @@ $.TokenList = function (input, url_or_data, settings) {
}
// Insert the new tokens
- insert_token(item);
- checkTokenLimit();
+ if(settings.tokenLimit == null || token_count < settings.tokenLimit) {
+ insert_token(item);
+ checkTokenLimit();
+ }
// Clear input box
input_box.val("");

0 comments on commit 32f2f35

Please sign in to comment.
Something went wrong with that request. Please try again.