- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
Line 77:
Line 77:
− +
Line 83:
Line 83:
+
Line 125:
Line 126:
+
+
+
+
+
+
+
+
no edit summary
}
}
//Update a multi toggle. If selected is passed it is set as the state of the multi toggle. Pass false to selected to deselect when the multi toggle is a filter.
//Update a multi toggle. If selected is passed it is set as the state of the multi toggle. Pass "none" to selected to deselect when the multi toggle is a filter.
function multi_update(multi_toggle_element, selected) {
function multi_update(multi_toggle_element, selected) {
var property = multi_toggle_element.data("target") || "default",
var property = multi_toggle_element.data("target") || "default",
property_default = multi_toggle_element.data("default"),
property_default = multi_toggle_element.data("default"),
property_filter = multi_toggle_element.data("filter") || false, //Whether or not the multi toggle is a filter
property_filter = multi_toggle_element.data("filter") || false, //Whether or not the multi toggle is a filter
property_base_colspan = multi_toggle_element.data("base-colspan"),
target = "multi-toggle-target-" + property;
target = "multi-toggle-target-" + property;
//make sure the states are an array.
//make sure the states are an array.
$(toggle_hide_selector).hide();
$(toggle_hide_selector).hide();
$("." + target + "-" + selected).show();
$("." + target + "-" + selected).show();
//Update colspan for custom rows.
if (property_filter)
if (selected === "none") {
$(".custom-row." + target).attr("colSpan", property_base_colspan);
} else {
$(".custom-row." + target).attr("colSpan", property_base_colspan - property_states.length + 2);
}
}
//cleanup
//cleanup
$(window).trigger("WideTablesScan");
$(window).trigger("WideTablesScan");