From f76bc15c56cc7afd5e8dfead1935e8511108ec3d Mon Sep 17 00:00:00 2001 From: Takumi Date: Tue, 30 Jul 2013 18:19:59 +1000 Subject: [PATCH] Uncheck auto if disabled field is clicked --- player.php | 2 +- sportspress-admin.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/player.php b/player.php index b52c9f84..d857cca2 100644 --- a/player.php +++ b/player.php @@ -43,7 +43,7 @@ function sp_player_stats_meta( $post ) { else $data[ $id ] = array(); endforeach; - sp_data_table( $data, 0, array( 'Team', 'Played', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ), false ); + sp_data_table( $data, 0, array( 'Team', 'Played', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ) ); } function sp_player_profile_meta( $post ) { diff --git a/sportspress-admin.js b/sportspress-admin.js index c1a65b15..b5d0b8bc 100644 --- a/sportspress-admin.js +++ b/sportspress-admin.js @@ -20,11 +20,19 @@ jQuery(document).ready(function($){ // Activate tab filters $('.sp-tab-panel').siblings('.sp-tab-select').find('select').change(); - // Stats table checkboxes + // Data table checkboxes $('.sp-data-table tr input[type=checkbox]').change(function() { $(this).closest('tr').find('input[type=text], input[type=number]').prop('readonly', $(this).prop('checked')); }) + // Uncheck auto to edit + $('.sp-data-table tr input[type=text], .sp-data-table tr input[type=text]').click(function() { + $el = $(this).closest('tr').find('input[type=checkbox]'); + if($el.size()) { + $el.prop('checked', false).change(); + } + }) + // Change title $('.sp-title-generator select').change(function() { title = $('.sp-title-generator select[value!=0]').map(function(){