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

Commit 5a0b789

Browse files
committed
clean up settings
1 parent a1af7f9 commit 5a0b789

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

src/jquery.tokeninput.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,46 @@
1111
(function ($) {
1212
// Default settings
1313
var DEFAULT_SETTINGS = {
14+
// Search settings
1415
propertyToSearch: "name",
16+
method: "GET",
17+
contentType: "json",
18+
queryParam: "q",
19+
searchDelay: 300,
20+
minChars: 1,
21+
jsonContainer: null,
22+
23+
// Display settings
1524
hintText: "Type in a search term",
1625
noResultsText: "No results",
1726
searchingText: "Searching...",
1827
deleteText: "×",
19-
searchDelay: 300,
20-
minChars: 1,
28+
animateDropdown: true,
29+
30+
// Tokenization settings
2131
tokenLimit: null,
22-
jsonContainer: null,
23-
method: "GET",
24-
contentType: "json",
25-
queryParam: "q",
2632
tokenDelimiter: ",",
27-
tokenValue: "id",
2833
preventDuplicates: false,
34+
35+
// Output settings
36+
tokenValue: "id",
37+
38+
// Prepopulation settings
2939
prePopulate: null,
3040
processPrePopulate: false,
31-
animateDropdown: true,
41+
42+
// Manipulation settings
43+
idPrefix: "token-input-",
44+
45+
// Formatters
3246
resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
3347
tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
48+
49+
// Callbacks
3450
onResult: null,
3551
onAdd: null,
3652
onDelete: null,
37-
onReady: null,
38-
idPrefix: "token-input-"
53+
onReady: null
3954
};
4055

4156
// Default classes to use when theming

0 commit comments

Comments
 (0)