Skip to content

Commit ca965de

Browse files
committed
Adding sifter's respect-word-boundary option. initial default is true
1 parent b98e6d6 commit ca965de

File tree

2 files changed

+77
-75
lines changed

2 files changed

+77
-75
lines changed

src/defaults.js

Lines changed: 75 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,94 @@
11
Selectize.count = 0;
22
Selectize.defaults = {
3-
options: [],
4-
optgroups: [],
3+
options: [],
4+
optgroups: [],
55

6-
plugins: [],
7-
delimiter: ',',
8-
splitOn: null, // regexp or string for splitting up values from a paste command
9-
persist: true,
10-
diacritics: true,
11-
create: false,
12-
showAddOptionOnCreate: true,
13-
createOnBlur: false,
14-
createFilter: null,
15-
highlight: true,
16-
openOnFocus: true,
17-
maxOptions: 1000,
18-
maxItems: null,
19-
hideSelected: null,
20-
addPrecedence: false,
21-
selectOnTab: true,
22-
preload: false,
23-
allowEmptyOption: false,
24-
showEmptyOptionInDropdown: false,
25-
emptyOptionLabel: '--',
6+
plugins: [],
7+
delimiter: ',',
8+
splitOn: null, // regexp or string for splitting up values from a paste command
9+
persist: true,
10+
diacritics: true,
11+
create: false,
12+
showAddOptionOnCreate: true,
13+
createOnBlur: false,
14+
createFilter: null,
15+
highlight: true,
16+
openOnFocus: true,
17+
maxOptions: 1000,
18+
maxItems: null,
19+
hideSelected: null,
20+
addPrecedence: false,
21+
selectOnTab: true,
22+
preload: false,
23+
allowEmptyOption: false,
24+
showEmptyOptionInDropdown: false,
25+
emptyOptionLabel: '--',
2626
setFirstOptionActive: false,
27-
closeAfterSelect: false,
27+
closeAfterSelect: false,
2828
closeDropdownThreshold: 250, // number of ms to prevent reopening of dropdown after mousedown
2929

30-
scrollDuration: 60,
31-
deselectBehavior: 'previous', //top, previous
32-
loadThrottle: 300,
33-
loadingClass: 'loading',
30+
scrollDuration: 60,
31+
deselectBehavior: 'previous', //top, previous
32+
loadThrottle: 300,
33+
loadingClass: 'loading',
3434

35-
dataAttr: 'data-data',
36-
optgroupField: 'optgroup',
37-
valueField: 'value',
38-
labelField: 'text',
39-
disabledField: 'disabled',
40-
optgroupLabelField: 'label',
41-
optgroupValueField: 'value',
42-
lockOptgroupOrder: false,
35+
dataAttr: 'data-data',
36+
optgroupField: 'optgroup',
37+
valueField: 'value',
38+
labelField: 'text',
39+
disabledField: 'disabled',
40+
optgroupLabelField: 'label',
41+
optgroupValueField: 'value',
42+
lockOptgroupOrder: false,
4343

44-
sortField: '$order',
45-
searchField: ['text'],
46-
searchConjunction: 'and',
44+
sortField: '$order',
45+
searchField: ['text'],
46+
searchConjunction: 'and',
47+
respect_word_boundaries: true,
4748

48-
mode: null,
49-
wrapperClass: '',
50-
inputClass: '',
51-
dropdownClass: '',
52-
dropdownContentClass: '',
49+
mode: null,
50+
wrapperClass: '',
51+
inputClass: '',
52+
dropdownClass: '',
53+
dropdownContentClass: '',
5354

54-
dropdownParent: null,
55+
dropdownParent: null,
5556

56-
copyClassesToDropdown: true,
57+
copyClassesToDropdown: true,
5758
dropdownSize: {
5859
sizeType: 'auto', // 'numberItems' or 'fixedHeight'
5960
sizeValue: 'auto', // number of items or height value (px is default) or CSS height (px, rem, em, vh)
6061
},
6162
normalize: false,
6263
ignoreOnDropwdownHeight: 'img, i',
63-
/*
64-
load : null, // function(query, callback) { ... }
65-
score : null, // function(search) { ... }
66-
formatValueToKey : null, // function(key) { ... }
67-
onInitialize : null, // function() { ... }
68-
onChange : null, // function(value) { ... }
69-
onItemAdd : null, // function(value, $item) { ... }
70-
onItemRemove : null, // function(value, $item) { ... }
71-
onClear : null, // function() { ... }
72-
onOptionAdd : null, // function(value, data) { ... }
73-
onOptionRemove : null, // function(value) { ... }
74-
onOptionClear : null, // function() { ... }
75-
onOptionGroupAdd : null, // function(id, data) { ... }
76-
onOptionGroupRemove : null, // function(id) { ... }
77-
onOptionGroupClear : null, // function() { ... }
78-
onDropdownOpen : null, // function($dropdown) { ... }
79-
onDropdownClose : null, // function($dropdown) { ... }
80-
onType : null, // function(str) { ... }
81-
onDelete : null, // function(values) { ... }
82-
*/
64+
/*
65+
load : null, // function(query, callback) { ... }
66+
score : null, // function(search) { ... }
67+
formatValueToKey : null, // function(key) { ... }
68+
onInitialize : null, // function() { ... }
69+
onChange : null, // function(value) { ... }
70+
onItemAdd : null, // function(value, $item) { ... }
71+
onItemRemove : null, // function(value, $item) { ... }
72+
onClear : null, // function() { ... }
73+
onOptionAdd : null, // function(value, data) { ... }
74+
onOptionRemove : null, // function(value) { ... }
75+
onOptionClear : null, // function() { ... }
76+
onOptionGroupAdd : null, // function(id, data) { ... }
77+
onOptionGroupRemove : null, // function(id) { ... }
78+
onOptionGroupClear : null, // function() { ... }
79+
onDropdownOpen : null, // function($dropdown) { ... }
80+
onDropdownClose : null, // function($dropdown) { ... }
81+
onType : null, // function(str) { ... }
82+
onDelete : null, // function(values) { ... }
83+
*/
8384

84-
render: {
85-
/*
86-
item: null,
87-
optgroup: null,
88-
optgroup_header: null,
89-
option: null,
90-
option_create: null
91-
*/
92-
}
85+
render: {
86+
/*
87+
item: null,
88+
optgroup: null,
89+
optgroup_header: null,
90+
option: null,
91+
option_create: null
92+
*/
93+
}
9394
};

src/selectize.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,8 @@ $.extend(Selectize.prototype, {
10721072
conjunction : settings.searchConjunction,
10731073
sort : sort,
10741074
nesting : settings.nesting,
1075-
filter : settings.filter
1075+
filter : settings.filter,
1076+
respect_word_boundaries : settings.respect_word_boundaries
10761077
};
10771078
},
10781079

0 commit comments

Comments
 (0)