Fix select all checkbox behavior
This commit is contained in:
@@ -49,23 +49,25 @@ jQuery(document).ready(function($){
|
|||||||
filter += ".sp-filter-"+filterval;
|
filter += ".sp-filter-"+filterval;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$panel = $(this).closest(".sp-tab-select").siblings(".sp-tab-panel")
|
$panel = $(this).closest(".sp-tab-select").siblings(".sp-tab-panel");
|
||||||
$panel.find(".sp-post").hide(0, function() {
|
$panel.each(function() {
|
||||||
|
$(this).find(".sp-post").hide(0, function() {
|
||||||
$(this).find("input").prop("disabled", true);
|
$(this).find("input").prop("disabled", true);
|
||||||
$(this).filter(filter).show(0, function() {
|
$(this).filter(filter).show(0, function() {
|
||||||
$(this).find("input").prop("disabled", false);
|
$(this).find("input").prop("disabled", false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if($panel.find(".sp-post:visible").length > 0) {
|
if($(this).find(".sp-post:visible").length > 0) {
|
||||||
$panel.find(".sp-select-all-container").show();
|
$(this).find(".sp-select-all-container").show();
|
||||||
$panel.find(".sp-show-all-container").show();
|
$(this).find(".sp-show-all-container").show();
|
||||||
$panel.find(".sp-not-found-container").hide();
|
$(this).find(".sp-not-found-container").hide();
|
||||||
} else {
|
} else {
|
||||||
$panel.find(".sp-select-all-container").hide();
|
$(this).find(".sp-select-all-container").hide();
|
||||||
$panel.find(".sp-show-all-container").hide();
|
$(this).find(".sp-show-all-container").hide();
|
||||||
$panel.find(".sp-not-found-container").show();
|
$(this).find(".sp-not-found-container").show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Trigger tab filter
|
// Trigger tab filter
|
||||||
$(".sp-tab-panel").siblings(".sp-tab-select").find("select").change();
|
$(".sp-tab-panel").siblings(".sp-tab-select").find("select").change();
|
||||||
@@ -77,7 +79,7 @@ jQuery(document).ready(function($){
|
|||||||
|
|
||||||
// Show all filter
|
// Show all filter
|
||||||
$(".sp-tab-panel").on("click", ".sp-show-all", function() {
|
$(".sp-tab-panel").on("click", ".sp-show-all", function() {
|
||||||
$(this).closest("li").hide().siblings(".sp-post").show().find("input").prop("disabled", false);
|
$(this).closest("li").hide().siblings(".sp-post, .sp-select-all-container").show().find("input").prop("disabled", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Self-cloning
|
// Self-cloning
|
||||||
@@ -231,7 +233,7 @@ jQuery(document).ready(function($){
|
|||||||
// Check if all checkboxes are checked already
|
// Check if all checkboxes are checked already
|
||||||
$(".sp-select-all-range").on("checkCheck", function() {
|
$(".sp-select-all-range").on("checkCheck", function() {
|
||||||
$(this).each(function() {
|
$(this).each(function() {
|
||||||
$(this).find(".sp-select-all").prop("checked", $(this).find("input[type=checkbox]:checked:not(.sp-select-all)").length == $(this).find("input[type=checkbox]:visible:not(.sp-select-all)").length);
|
$(this).find(".sp-select-all").prop("checked", $(this).find("input[type=checkbox]:checked:not(.sp-select-all)").length != 0 && $(this).find("input[type=checkbox]:checked:not(.sp-select-all)").length == $(this).find("input[type=checkbox]:visible:not(.sp-select-all)").length);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user