Add show all links to post checklist
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -722,7 +722,13 @@ if ( !function_exists( 'sp_post_checklist' ) ) {
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<li class="sp-not-found-container"><?php _e( 'No results found.', 'sportspress' ); ?></li>
|
||||
<li class="sp-not-found-container">
|
||||
<?php _e( 'No results found.', 'sportspress' ); ?>
|
||||
<?php if ( sizeof( $posts ) ): ?><a class="sp-show-all" href="#show-all-<?php echo $meta; ?>s"><?php _e( 'Show all', 'sportspress' ); ?></a><?php endif; ?>
|
||||
</li>
|
||||
<?php if ( sizeof( $posts ) ): ?>
|
||||
<li class="sp-show-all-container"><a class="sp-show-all" href="#show-all-<?php echo $meta; ?>s"><?php _e( 'Show all', 'sportspress' ); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user