* Don't clear link colour when switching layouts

* Update "default colour" link when a custom colour has been selected
Fixes #17746

git-svn-id: http://svn.automattic.com/wordpress/trunk@18229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2011-06-10 13:41:51 +00:00
parent 5df56d4bba
commit 40a3ce969a
2 changed files with 9 additions and 9 deletions

View File

@ -39,14 +39,14 @@ var farbtastic;
e.preventDefault(); e.preventDefault();
}); });
$('.image-radio-option input:radio').change( function() { $('.image-radio-option.color-scheme input:radio').change( function() {
var currentDefault = $('#default-color a'), var currentDefault = $('#default-color a'),
newDefault;
if ( $('#link-color').val() !== currentDefault.text() )
return;
newDefault = $(this).next().val(); newDefault = $(this).next().val();
currentDefault.text( newDefault );
if ( $('#link-color').val() == currentDefault.text() )
pickColor( newDefault ); pickColor( newDefault );
currentDefault.text( newDefault );
}); });
}); });
})(jQuery); })(jQuery);

View File

@ -22,7 +22,7 @@ function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
return; return;
wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' ); wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );
wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-04-28' ); wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' );
wp_enqueue_style( 'farbtastic' ); wp_enqueue_style( 'farbtastic' );
} }
add_action( 'admin_enqueue_scripts', 'twentyeleven_admin_enqueue_scripts' ); add_action( 'admin_enqueue_scripts', 'twentyeleven_admin_enqueue_scripts' );
@ -224,7 +224,7 @@ function theme_options_render_page() {
<table class="form-table"> <table class="form-table">
<tr valign="top" class="image-radio-option"><th scope="row"><?php _e( 'Color Scheme', 'twentyeleven' ); ?></th> <tr valign="top" class="image-radio-option color-scheme"><th scope="row"><?php _e( 'Color Scheme', 'twentyeleven' ); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e( 'Color Scheme', 'twentyeleven' ); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Color Scheme', 'twentyeleven' ); ?></span></legend>
<?php <?php
@ -260,7 +260,7 @@ function theme_options_render_page() {
</td> </td>
</tr> </tr>
<tr valign="top" class="image-radio-option"><th scope="row"><?php _e( 'Default Layout', 'twentyeleven' ); ?></th> <tr valign="top" class="image-radio-option theme-layout"><th scope="row"><?php _e( 'Default Layout', 'twentyeleven' ); ?></th>
<td> <td>
<fieldset><legend class="screen-reader-text"><span><?php _e( 'Color Scheme', 'twentyeleven' ); ?></span></legend> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Color Scheme', 'twentyeleven' ); ?></span></legend>
<?php <?php