harvesthq/chosen — Issue #308: .chzn-select and .chzn-select-deselect
Author: victor-homyakov
Created: 2011-10-21 09:46:38+00:00
State: open

Currently you have two different classes to declare different strategies for Chosen creation: `chzn-select` and `chzn-select-deselect`. User should manually check these classes and make decision which of two constructor forms to call.

I propose to make `chzn-select-deselect` optional (additional to `chzn-select`). In this case all selects will have at least class `chzn-select`, and some of them will have two classes `chzn-select chzn-select-deselect`, so logic for setting `allow_single_deselect` can be moved from user code into constructor. For user this look exactly as in versions before `chzn-select-deselect` was introduced:
$$(".chzn-select").each(function(select) {
new Chosen(select);
});
instead of
$$(".chzn-select").each(function(select) {
new Chosen(select);
});
$$(".chzn-select-deselect").each(function(select) {
new Chosen(select, {
allow_single_deselect: true
});
});