Uncheck auto if disabled field is clicked

This commit is contained in:
Takumi
2013-07-30 18:19:59 +10:00
parent 71fa14d398
commit f76bc15c56
2 changed files with 10 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ function sp_player_stats_meta( $post ) {
else else
$data[ $id ] = array(); $data[ $id ] = array();
endforeach; 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 ) { function sp_player_profile_meta( $post ) {

View File

@@ -20,11 +20,19 @@ jQuery(document).ready(function($){
// Activate tab filters // Activate tab filters
$('.sp-tab-panel').siblings('.sp-tab-select').find('select').change(); $('.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() { $('.sp-data-table tr input[type=checkbox]').change(function() {
$(this).closest('tr').find('input[type=text], input[type=number]').prop('readonly', $(this).prop('checked')); $(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 // Change title
$('.sp-title-generator select').change(function() { $('.sp-title-generator select').change(function() {
title = $('.sp-title-generator select[value!=0]').map(function(){ title = $('.sp-title-generator select[value!=0]').map(function(){