Changeset 26137 for trunk/src/wp-admin/js/user-profile.js
- Timestamp:
- 11/13/2013 07:37:10 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/js/user-profile.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/user-profile.js
r25637 r26137 74 74 }); 75 75 } 76 77 var $colorpicker = $( '#color-picker' ), 78 $stylesheet = $( '#colors-css' ), 79 user_id = $( 'input#user_id' ).val(), 80 current_user_id = $( 'input[name="checkuser_id"]' ).val(); 81 82 // dropdown toggle 83 $colorpicker.on( 'click', '.dropdown-current', function() { 84 $colorpicker.toggleClass( 'picker-expanded' ); 85 }); 86 87 $colorpicker.on( 'click', '.color-option', function() { 88 89 var color_scheme = $( this ).children( 'input[name="admin_color"]' ).val(); 90 91 // update selected 92 $( this ).siblings( '.selected' ).removeClass( 'selected' ) 93 $( this ).addClass( 'selected' ); 94 $( this ).find( 'input' ).prop( 'checked', true ); 95 96 // update current 97 $colorpicker.find( '.dropdown-current label' ).html( $( this ).children( 'label' ).html() ); 98 $colorpicker.find( '.dropdown-current table' ).html( $( this ).children( 'table' ).html() ); 99 $colorpicker.toggleClass( 'picker-expanded' ); 100 101 // preview/save color scheme 102 if ( user_id == current_user_id ) { 103 104 // repaint icons 105 $stylesheet.attr( 'href', $( this ).children( '.css_url' ).val() ); 106 svgPainter.setColors( $.parseJSON( $( this ).children( '.icon_colors' ).val() ) ); 107 svgPainter.paint(); 108 109 // update user option 110 $.post( ajaxurl, { 111 action: 'save-user-color-scheme', 112 color_scheme: color_scheme, 113 user_id: user_id 114 }); 115 116 } 117 118 }); 119 76 120 }); 77 121
Note: See TracChangeset
for help on using the changeset viewer.