Custom background UI updates. props ocean90 for initial patch, see #12186.

git-svn-id: https://develop.svn.wordpress.org/trunk@14684 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-16 05:17:57 +00:00
parent d7130b8341
commit ae5af53f10
5 changed files with 42 additions and 51 deletions
+3 -8
View File
@@ -12,8 +12,7 @@ jQuery(document).ready(function() {
});
jQuery('#background-color').keyup(function() {
var _hex = jQuery('#background-color').val();
var hex = _hex;
var _hex = jQuery('#background-color').val(), hex = _hex;
if ( hex[0] != '#' )
hex = '#' + hex;
hex = hex.replace(/[^#a-fA-F0-9]+/, '');
@@ -23,17 +22,13 @@ jQuery(document).ready(function() {
pickColor( hex );
});
jQuery('input[name="background-position"]').change(function() {
jQuery('#custom-background-image').css('background-position', 'top ' + jQuery(this).val());
jQuery('input[name="background-position-x"]').change(function() {
jQuery('#custom-background-image').css('background-position', jQuery(this).val() + ' top');
});
jQuery('select[name="background-repeat"]').change(function() {
jQuery('#custom-background-image').css('background-repeat', jQuery(this).val());
});
jQuery('input[name="background-attachment"]').change(function() {
jQuery('#custom-background-image').css('background-attachment', jQuery(this).val());
});
farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) {
pickColor(color);