Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Duplicate token detection should also work for newly created tokens, …

…based on their value
  • Loading branch information...
commit e3ac7c0353a3aa74a1dc838495695b176c266d36 1 parent ae74979
@manuelbernhardt authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  src/jquery.tokeninput.js
View
3  src/jquery.tokeninput.js
@@ -44,7 +44,6 @@ var DEFAULT_SETTINGS = {
// Callbacks
onResult: null,
- onCreate: null,
onAdd: null,
onDelete: null,
onReady: null,
@@ -494,7 +493,7 @@ $.TokenList = function (input, url_or_data, settings) {
token_list.children().each(function () {
var existing_token = $(this);
var existing_data = $.data(existing_token.get(0), "tokeninput");
- if(existing_data && existing_data.id === item.id) {
+ if(existing_data && (existing_data.id === item.id || item.wasCreated && existing_data.name === item.name)) {
found_existing_token = existing_token;
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.