mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
Fix custom background selector for IE7. props duck_, fixes #14152.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b68d28a728
commit
484aebcf5c
@ -14,7 +14,7 @@ jQuery(document).ready(function() {
|
|||||||
|
|
||||||
jQuery('#background-color').keyup(function() {
|
jQuery('#background-color').keyup(function() {
|
||||||
var _hex = jQuery('#background-color').val(), hex = _hex;
|
var _hex = jQuery('#background-color').val(), hex = _hex;
|
||||||
if ( hex[0] != '#' )
|
if ( hex.charAt(0) != '#' )
|
||||||
hex = '#' + hex;
|
hex = '#' + hex;
|
||||||
hex = hex.replace(/[^#a-fA-F0-9]+/, '');
|
hex = hex.replace(/[^#a-fA-F0-9]+/, '');
|
||||||
if ( hex != _hex )
|
if ( hex != _hex )
|
||||||
|
@ -1 +1 @@
|
|||||||
var farbtastic;function pickColor(a){farbtastic.setColor(a);jQuery("#background-color").val(a);jQuery("#custom-background-image").css("background-color",a)}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show();return false});jQuery("#background-color").keyup(function(){var b=jQuery("#background-color").val(),a=b;if(a[0]!="#"){a="#"+a}a=a.replace(/[^#a-fA-F0-9]+/,"");if(a!=b){jQuery("#background-color").val(a)}if(a.length==4||a.length==7){pickColor(a)}});jQuery('input[name="background-position-x"]').change(function(){jQuery("#custom-background-image").css("background-position",jQuery(this).val()+" top")});jQuery('input[name="background-repeat"]').change(function(){jQuery("#custom-background-image").css("background-repeat",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(a){pickColor(a)});pickColor(jQuery("#background-color").val());jQuery(document).mousedown(function(){jQuery("#colorPickerDiv").each(function(){var a=jQuery(this).css("display");if(a=="block"){jQuery(this).fadeOut(2)}})})});
|
var farbtastic;function pickColor(a){farbtastic.setColor(a);jQuery("#background-color").val(a);jQuery("#custom-background-image").css("background-color",a)}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show();return false});jQuery("#background-color").keyup(function(){var b=jQuery("#background-color").val(),a=b;if(a.charAt(0)!="#"){a="#"+a}a=a.replace(/[^#a-fA-F0-9]+/,"");if(a!=b){jQuery("#background-color").val(a)}if(a.length==4||a.length==7){pickColor(a)}});jQuery('input[name="background-position-x"]').change(function(){jQuery("#custom-background-image").css("background-position",jQuery(this).val()+" top")});jQuery('input[name="background-repeat"]').change(function(){jQuery("#custom-background-image").css("background-repeat",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(a){pickColor(a)});pickColor(jQuery("#background-color").val());jQuery(document).mousedown(function(){jQuery("#colorPickerDiv").each(function(){var a=jQuery(this).css("display");if(a=="block"){jQuery(this).fadeOut(2)}})})});
|
@ -416,7 +416,7 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
|
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20100531' );
|
$scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20101025' );
|
||||||
$scripts->add_data( 'custom-background', 'group', 1 );
|
$scripts->add_data( 'custom-background', 'group', 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user