Changes
no edit summary
function update(toggle_element, toggle) {
function update(toggle_element, toggle) {
var property = toggle_element.data("target") || "default",
var property = toggle_element.data("target") || "default",
property_anti = toggle_element.data("anti-target"),
property_default = toggle_element.data("default") || "show",
property_default = toggle_element.data("default") || "show",
target = "toggle-target-" + property,
target = "toggle-target-" + property,
target_class = "." + target,
target_class = "." + target,
anti_target_class,
toggleStorage = ToggleStorage(target, property_default);
toggleStorage = ToggleStorage(target, property_default);
if (property_anti) {
anti_target_class = ".toggle-anti-target-" + property;
}
if (toggle) {
if (toggle) {
toggleStorage.toggle();
toggleStorage.toggle();
$(".toggle-hide").hide();
$(".toggle-hide").hide();
$(target_class).show();
$(target_class).show();
if (anti_target_class) {
$(anti_target_class).hide();
}
} else {
} else {
$(".toggle-show").hide();
$(".toggle-show").hide();
$(".toggle-hide").show();
$(".toggle-hide").show();
$(target_class).hide();
$(target_class).hide();
if (anti_target_class) {
$(anti_target_class).show();
}
}
}
}
}