Skip to content

Commit

Permalink
Merge pull request loopj#129 from vicox/master
Browse files Browse the repository at this point in the history
Don't add tokens if limit has been reached.
  • Loading branch information
loopj committed Jul 8, 2011
2 parents 3c115b1 + 32f2f35 commit e3501ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/jquery.tokeninput.js
Expand Up @@ -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("");
Expand Down

0 comments on commit e3501ad

Please sign in to comment.