WordPress.org

Make WordPress Core

Ticket #12186: fix_position_preview.diff

File fix_position_preview.diff, 3.0 KB (added by eddieringle, 4 years ago)

Centered preview works now

  • wp-admin/js/custom-background.dev.js

     
    2222                        pickColor( hex ); 
    2323        }); 
    2424        jQuery('input[name="background-position"]').change(function() { 
    25                 jQuery('#custom-background-image img').attr('align', jQuery(this).val() ); 
     25                jQuery('#custom-background-image').css('text-align', jQuery(this).val()); 
    2626        }); 
    2727 
    2828        farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) { 
  • wp-admin/js/custom-background.js

     
    1 var buttons=["#pickcolor"],farbtastic;function pickColor(color){jQuery("#background-color").val(color);farbtastic.setColor(color);jQuery("#custom-background-image").css("background-color",color)}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show()});jQuery("#background-color").keyup(function(){var _hex=jQuery("#background-color").val();var hex=_hex;if(hex[0]!="#"){hex="#"+hex}hex=hex.replace(/[^#a-fA-F0-9]+/,"");if(hex!=_hex){jQuery("#background-color").val(hex)}if(hex.length==4||hex.length==7){pickColor(hex)}});jQuery('input[name="background-position"]').change(function(){jQuery("#custom-background-image img").attr("align",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(color){pickColor(color)});pickColor(customBackgroundL10n.backgroundcolor)});jQuery(document).mousedown(function(){hide_picker()});function hide_picker(what){var update=false;jQuery("#colorPickerDiv").each(function(){var id=jQuery(this).attr("id");if(id==what){return}var display=jQuery(this).css("display");if(display=="block"){jQuery(this).fadeOut(2)}})}; 
    2  No newline at end of file 
     1var buttons=['#pickcolor'],farbtastic;function pickColor(color){jQuery('#background-color').val(color);farbtastic.setColor(color);jQuery('#custom-background-image').css('background-color',color);}jQuery(document).ready(function(){jQuery('#pickcolor').click(function(){jQuery('#colorPickerDiv').show();});jQuery('#background-color').keyup(function(){var _hex=jQuery('#background-color').val();var hex=_hex;if(hex[0]!='#')hex='#'+hex;hex=hex.replace(/[^#a-fA-F0-9]+/,'');if(hex!=_hex)jQuery('#background-color').val(hex);if(hex.length==4||hex.length==7)pickColor(hex);});jQuery('input[name="background-position"]').change(function(){jQuery('#custom-background-image').css('text-align',jQuery(this).val());});farbtastic=jQuery.farbtastic('#colorPickerDiv',function(color){pickColor(color);});pickColor(customBackgroundL10n.backgroundcolor);});jQuery(document).mousedown(function(){hide_picker();});function hide_picker(what){var update=false;jQuery('#colorPickerDiv').each(function(){var id=jQuery(this).attr('id');if(id==what)return;var display=jQuery(this).css('display');if(display=='block')jQuery(this).fadeOut(2);});} 
     2 No newline at end of file