Display checklist only when needed

This commit is contained in:
Brian Miyaji
2015-09-27 12:19:27 +10:00
parent 1bbf4ac962
commit a10aab6a70
3 changed files with 8 additions and 10 deletions

View File

@@ -457,12 +457,6 @@ jQuery(document).ready(function($){
// Trigger player list layout change
$(".post-type-sp_list #post-formats-select input.post-format").trigger("change");
// Auto-select hides options
$(".sp-select-setting").find("select").change(function() {
$(".sp-select-all-range").toggle("manual"==$(this).val());
$(this).closest(".sp-select-setting").siblings(".sp-tab-select").find("select").change()
});
// Configure primary result option (Ajax)
$(".sp-admin-config-table").on("click", ".sp-primary-result-option", function() {
$.post( ajaxurl, {

View File

@@ -91,8 +91,10 @@ class SP_Meta_Box_List_Details {
</select>
</p>
<?php
sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) );
sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
if ( 'manual' == $select ) {
sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) );
sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
}
?>
</div>
<?php

View File

@@ -43,8 +43,10 @@ class SP_Meta_Box_Table_Details {
</select>
</p>
<?php
sp_post_checklist( $post->ID, 'sp_team', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ) );
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
if ( 'manual' == $select ) {
sp_post_checklist( $post->ID, 'sp_team', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season' ) );
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
}
?>
</div>
<?php