Changes
Hopefully a little optimization
//set the new state of the multi toggle.
//set the new state of the multi toggle.
if (selected && property_states.indexOf(selected) >= 0) {
if (selected && property_states.indexOf(selected) >= 0) {
//If the selected filter was re-selected, that is a remove filter action.
if ((property_filter && multiToggleStorage.on(selected))) {
if ((property_filter && multiToggleStorage.on(selected))) {
selected = "none";
selected = "none";
multiToggleStorage.set(selected);
multiToggleStorage.set(selected);
} else {
} else {
//No selection, so we are initializing the multi toggle.
selected = multiToggleStorage.get()
selected = multiToggleStorage.get()
}
}
//Update non-selected states
//Update non-selected states
var hide_selectors = [];
var show_selectors = [];
property_states.forEach(function(state) {
property_states.forEach(function(state) {
var toggle_show_selector = '.multi-toggle[data-target="' + property + '"] .multi-toggle-button[data-state="' + state + '"] .multi-toggle-active',
var toggle_active_selector = '.multi-toggle[data-target="' + property + '"] .multi-toggle-button[data-state="' + state + '"] .multi-toggle-active',
toggle_inactive_selector = '.multi-toggle[data-target="' + property + '"] .multi-toggle-button[data-state="' + state + '"] .multi-toggle-inactive';
if (!multiToggleStorage.on(state)) {
if (selected !== state) {
$(toggle_show_selector).hide();
$(toggle_active_selector).hide();
$(toggle_hide_selector).show();
$(toggle_inactive_selector).show();
if (selected === "none") {
if (selected === "none") {
show_selectors.push("." + target + "-" + state);
} else {
} else {
hide_selectors.push("." + target + "-" + state);
}
}
} else {
$(toggle_active_selector).show();
$(toggle_inactive_selector).hide();
show_selectors.push("." + target + "-" + state);
}
}
})
})
$(hide_selectors.join(',')).hide();
//Update selected state last
//Update selected state last
$(show_selectors.join(',')).show();
//Update colspan for custom rows.
//Update colspan for custom rows.
if (property_filter) {
if (property_filter) {