Changeset 21004
- Timestamp:
- 06/05/2012 06:57:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/custom-background.dev.js
r20944 r21004 3 3 (function($) { 4 4 5 pickColor = function(color, cleared) { 5 var defaultColor = ''; 6 7 pickColor = function(color) { 6 8 farbtastic.setColor(color); 7 9 $('#background-color').val(color); 8 10 $('#custom-background-image').css('background-color', color); 9 console.log( color ); 10 if ( typeof cleared === 'undefined' ) 11 cleared = ! color || color === '#'; 12 if ( cleared ) 11 // If we have a default color, and they match, then we need to hide the 'Default' link. 12 // Otherwise, we hide the 'Clear' link when it is empty. 13 if ( ( defaultColor && color === defaultColor ) || ( ! defaultColor && ( '' === color || '#' === color ) ) ) 13 14 $('#clearcolor').hide(); 14 15 else … … 18 19 $(document).ready(function() { 19 20 21 defaultColor = $('#defaultcolor').val(); 22 20 23 $('#pickcolor').click(function() { 21 24 $('#colorPickerDiv').show(); … … 24 27 25 28 $('#clearcolor a').click( function(e) { 26 pickColor( $('#defaultcolor').val(), true);29 pickColor( defaultColor ); 27 30 e.preventDefault(); 28 31 });
Note: See TracChangeset
for help on using the changeset viewer.