Skip to content

Commit 5a1f913

Browse files
committed
Merge pull request selectize#577 from leevigraham/master
Added option to disable copying of input classes to drop down.
2 parents 2d22156 + 839446e commit 5a1f913

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

docs/usage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ $(function() {
217217
<td valign="top"><code>array</code></td>
218218
<td valign="top"><code>null</code></td>
219219
</tr>
220+
<tr>
221+
<td valign="top"><code>copyClassesToDropdown</code></td>
222+
<td valign="top">Copy the original input classes to the Dropdown element.</td>
223+
<td valign="top"><code>boolean</code></td>
224+
<td valign="top"><code>true</code></td>
225+
</tr>
220226
<tr>
221227
<th valign="top" colspan="4" align="left"><a href="#callbacks" name="callbacks">Callbacks</a></th>
222228
</tr>

src/defaults.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Selectize.defaults = {
4040

4141
dropdownParent: null,
4242

43+
copyClassesToDropdown: true,
44+
4345
/*
4446
load : null, // function(query, callback) { ... }
4547
score : null, // function(search) { ... }
@@ -66,4 +68,4 @@ Selectize.defaults = {
6668
option_create: null
6769
*/
6870
}
69-
};
71+
};

src/selectize.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ $.extend(Selectize.prototype, {
115115
$control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
116116
$control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', tab_index);
117117
$dropdown_parent = $(settings.dropdownParent || $wrapper);
118-
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(classes).addClass(inputMode).hide().appendTo($dropdown_parent);
118+
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
119119
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
120120

121+
if(self.settings.copyClassesToDropdown) {
122+
debugger;
123+
$dropdown.addClass(classes);
124+
}
125+
121126
$wrapper.css({
122127
width: $input[0].style.width
123128
});

0 commit comments

Comments
 (0)