mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Applying chosen.js behaviour to all <select multiple>, rather than arbitrarily limiting to a CheckboxSetField. Also fixed a bug where those fields would get the '.has-chzn' class even if it wasn't applied due to a missing <select> element.
This commit is contained in:
parent
a6a7b2e469
commit
eab8401c7d
@ -363,10 +363,11 @@ jQuery.noConflict();
|
|||||||
* we can fix the height cropping.
|
* we can fix the height cropping.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$('.cms .field.dropdown, .cms .field.checkboxset').entwine({
|
$('.cms .field.dropdown select, .cms .field select[multiple]').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
$(this).find("select:not(.no-chzn)").data('placeholder', ' ').chosen();
|
if(this.is('.no-chzn')) return;
|
||||||
$(this).addClass("has-chzn");
|
|
||||||
|
this.data('placeholder', ' ').chosen().addClass("has-chzn");
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user