Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Commit 01885b0

Browse files
committed
renamed excludeCurrentParam to excludeCurrentParameter & other code cleanup
1 parent 88fe0a0 commit 01885b0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/jquery.tokeninput.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var DEFAULT_SETTINGS = {
2020
jsonContainer: null,
2121
contentType: "json",
2222
excludeCurrent: false,
23-
excludeCurrentParam: "x",
23+
excludeCurrentParameter: "x",
2424

2525
// Prepopulation settings
2626
prePopulate: null,
@@ -843,11 +843,10 @@ $.TokenList = function (input, url_or_data, settings) {
843843

844844
// exclude existing tokens from dropdown, so the list is clearer
845845
function excludeCurrent(results) {
846-
// if enabled, remove existing tokens
847846
if ($(input).data("settings").excludeCurrent) {
848847
var currentTokens = $(input).data("tokenInputObject").getTokens(),
849848
trimmedList = [];
850-
if (currentTokens.length > 0) {
849+
if (currentTokens.length) {
851850
$.each(results, function(index, value) {
852851
var notFound = true;
853852
$.each(currentTokens, function(cIndex, cValue) {
@@ -1015,7 +1014,7 @@ $.TokenList = function (input, url_or_data, settings) {
10151014
return el[$(input).data("settings").tokenValue];
10161015
});
10171016

1018-
ajax_params.data[$(input).data("settings").excludeCurrentParam] = tokenList.join($(input).data("settings").tokenDelimiter);
1017+
ajax_params.data[$(input).data("settings").excludeCurrentParameter] = tokenList.join($(input).data("settings").tokenDelimiter);
10191018
}
10201019

10211020
// Attach the success callback

0 commit comments

Comments
 (0)