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:
Ingo Schommer 2012-03-05 09:21:24 +01:00
parent a6a7b2e469
commit eab8401c7d

View File

@ -363,10 +363,11 @@ jQuery.noConflict();
* we can fix the height cropping.
*/
$('.cms .field.dropdown, .cms .field.checkboxset').entwine({
$('.cms .field.dropdown select, .cms .field select[multiple]').entwine({
onmatch: function() {
$(this).find("select:not(.no-chzn)").data('placeholder', ' ').chosen();
$(this).addClass("has-chzn");
if(this.is('.no-chzn')) return;
this.data('placeholder', ' ').chosen().addClass("has-chzn");
this._super();
}