Permalink
Browse files

MINOR Applying chosen.js behaviour to all <select multiple>, rather t…

…han 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.
  • Loading branch information...
1 parent a6a7b2e commit eab8401c7d8acd39d8a40ac71ab965cd80671d78 @chillu chillu committed Mar 5, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 admin/javascript/LeftAndMain.js
@@ -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();
}

0 comments on commit eab8401

Please sign in to comment.