Skip to content

Commit 6893cbf

Browse files
committed
Simplify and avoid confusion by using create: true instead of explicit and equivalent function
1 parent ad4f519 commit 6893cbf

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

Diff for: examples/basic.html

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ <h2>&lt;input type="text"&gt;</h2>
3030
$('#input-tags').selectize({
3131
persist: false,
3232
createOnBlur: true,
33-
create: function(input) {
34-
return {
35-
value: input,
36-
text: input
37-
}
38-
}
33+
create: true
3934
});
4035
</script>
4136
</div>

Diff for: examples/plugins.html

+3-18
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ <h2>Plugin: "remove_button"</h2>
3535
$('.input-tags').selectize({
3636
plugins: ['remove_button'],
3737
persist: false,
38-
create: function(input) {
39-
return {
40-
value: input,
41-
text: input
42-
}
43-
},
38+
create: true,
4439
render: {
4540
item: function(data, escape) {
4641
return '<div>"' + escape(data.text) + '"</div>';
@@ -63,12 +58,7 @@ <h2>Plugin: "restore_on_backspace"</h2>
6358
$('#input-tags6').selectize({
6459
plugins: ['restore_on_backspace'],
6560
persist: false,
66-
create: function(input) {
67-
return {
68-
value: input,
69-
text: input
70-
}
71-
}
61+
create: true
7262
});
7363
</script>
7464
</div>
@@ -87,12 +77,7 @@ <h2>Plugin: "drag_drop"</h2>
8777
$('.input-sortable').selectize({
8878
plugins: ['drag_drop'],
8979
persist: false,
90-
create: function(input) {
91-
return {
92-
value: input,
93-
text: input
94-
}
95-
}
80+
create: true
9681
});
9782
</script>
9883
</div>

Diff for: examples/rtl.html

+1-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ <h2>Right-to-left Support (RTL)</h2>
2929
<script>
3030
$('#input-tags').selectize({
3131
persist: false,
32-
create: function(input) {
33-
return {
34-
value: input,
35-
text: input
36-
}
37-
}
32+
create: true
3833
});
3934
</script>
4035
</div>

0 commit comments

Comments
 (0)