This repository was archived by the owner on Sep 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Original file line number Diff line number Diff line change 11
11
( function ( $ ) {
12
12
// Default settings
13
13
var DEFAULT_SETTINGS = {
14
+ // Search settings
14
15
propertyToSearch : "name" ,
16
+ method : "GET" ,
17
+ contentType : "json" ,
18
+ queryParam : "q" ,
19
+ searchDelay : 300 ,
20
+ minChars : 1 ,
21
+ jsonContainer : null ,
22
+
23
+ // Display settings
15
24
hintText : "Type in a search term" ,
16
25
noResultsText : "No results" ,
17
26
searchingText : "Searching..." ,
18
27
deleteText : "×" ,
19
- searchDelay : 300 ,
20
- minChars : 1 ,
28
+ animateDropdown : true ,
29
+
30
+ // Tokenization settings
21
31
tokenLimit : null ,
22
- jsonContainer : null ,
23
- method : "GET" ,
24
- contentType : "json" ,
25
- queryParam : "q" ,
26
32
tokenDelimiter : "," ,
27
- tokenValue : "id" ,
28
33
preventDuplicates : false ,
34
+
35
+ // Output settings
36
+ tokenValue : "id" ,
37
+
38
+ // Prepopulation settings
29
39
prePopulate : null ,
30
40
processPrePopulate : false ,
31
- animateDropdown : true ,
41
+
42
+ // Manipulation settings
43
+ idPrefix : "token-input-" ,
44
+
45
+ // Formatters
32
46
resultsFormatter : function ( item ) { return "<li>" + item [ this . propertyToSearch ] + "</li>" } ,
33
47
tokenFormatter : function ( item ) { return "<li><p>" + item [ this . propertyToSearch ] + "</p></li>" } ,
48
+
49
+ // Callbacks
34
50
onResult : null ,
35
51
onAdd : null ,
36
52
onDelete : null ,
37
- onReady : null ,
38
- idPrefix : "token-input-"
53
+ onReady : null
39
54
} ;
40
55
41
56
// Default classes to use when theming
You can’t perform that action at this time.
0 commit comments