From c128aeb44767064057cd980185d4f37461b75b3c Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sat, 21 Jun 2014 12:55:41 +1000 Subject: [PATCH] Add show all links to post checklist --- assets/js/admin/sportspress-admin.js | 12 ++++++++++++ includes/sp-core-functions.php | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/assets/js/admin/sportspress-admin.js b/assets/js/admin/sportspress-admin.js index 7296ac14..5297a8ca 100644 --- a/assets/js/admin/sportspress-admin.js +++ b/assets/js/admin/sportspress-admin.js @@ -58,9 +58,11 @@ jQuery(document).ready(function($){ }); if($panel.find(".sp-post:visible").length > 0) { $panel.find(".sp-select-all-container").show(); + $panel.find(".sp-show-all-container").show(); $panel.find(".sp-not-found-container").hide(); } else { $panel.find(".sp-select-all-container").hide(); + $panel.find(".sp-show-all-container").hide(); $panel.find(".sp-not-found-container").show(); } }); @@ -68,6 +70,16 @@ jQuery(document).ready(function($){ // Trigger tab filter $(".sp-tab-panel").siblings(".sp-tab-select").find("select").change(); + // Filter show all action links + $(".sp-tab-panel").find(".sp-post input:checked").each(function() { + $(this).prop("disabled", false).closest("li").show().siblings(".sp-not-found-container").hide().siblings(".sp-show-all-container").show(); + }); + + // Show all filter + $(".sp-tab-panel").on("click", ".sp-show-all", function() { + $(this).closest("li").hide().siblings(".sp-post").show().find("input").prop("disabled", false); + }); + // Self-cloning $(".sp-clone:last").find("select").change(function() { $(this).closest(".sp-clone").siblings().find("select").change(function() { diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 64025f12..cd492680 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -722,7 +722,13 @@ if ( !function_exists( 'sp_post_checklist' ) ) { -
  • +
  • + + +
  • + +
  • +