Changeset 36851
- Timestamp:
- 03/04/2016 11:46:07 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/customize-controls.css
r36837 r36851 722 722 .customize-control-cropped_image .current, 723 723 .customize-control-site_icon .current, 724 .customize-control-custom_logo .current,725 724 .customize-control-header .current { 726 725 margin-bottom: 8px; … … 764 763 .customize-control-site_icon .default-button, 765 764 .customize-control-site_icon .upload-button, 766 .customize-control-custom_logo .remove-button,767 .customize-control-custom_logo .default-button,768 .customize-control-custom_logo .upload-button,769 765 .customize-control-header button.new, 770 766 .customize-control-header button.remove { … … 780 776 .customize-control-cropped_image .current .container, 781 777 .customize-control-site_icon .current .container, 782 .customize-control-custom_logo .current .container,783 778 .customize-control-header .current .container { 784 779 overflow: hidden; … … 794 789 .customize-control-cropped_image .current .container, 795 790 .customize-control-site_icon .current .container, 796 .customize-control-custom_logo .current .container,797 791 .customize-control-image .current .container { 798 792 min-height: 40px; … … 823 817 .customize-control-cropped_image .inner, 824 818 .customize-control-site_icon .inner, 825 .customize-control-custom_logo .inner,826 819 .customize-control-header .inner { 827 820 display: none; … … 839 832 .customize-control-cropped_image .inner, 840 833 .customize-control-site_icon .inner, 841 .customize-control-custom_logo .inner,842 834 .customize-control-image .inner { 843 835 display: block; … … 851 843 .customize-control-cropped_image .inner, 852 844 .customize-control-site_icon .inner, 853 .customize-control-custom_logo.inner,854 845 .customize-control-header .inner, 855 846 .customize-control-header .inner .dashicons { … … 951 942 } 952 943 953 .customize-control-media .actions,954 .customize-control-upload .actions,955 .customize-control-image .actions,956 .customize-control-background .actions,957 .customize-control-cropped_image .actions,958 .customize-control-site_icon .actions,959 .customize-control-header .actions {960 margin-bottom: 32px;961 }962 963 944 .customize-control-header .choice { 964 945 position: relative; … … 995 976 .customize-control-site_icon .remove-button, 996 977 .customize-control-site_icon .default-button, 997 .customize-control-custom_logo .remove-button,998 .customize-control-custom_logo .default-button,999 978 .customize-control-header .remove { 1000 979 float: left; … … 1008 987 .customize-control-cropped_image .upload-button, 1009 988 .customize-control-site_icon .upload-button, 1010 .customize-control-custom_logo .upload-button,1011 989 .customize-control-header .new { 1012 990 float: right; -
trunk/src/wp-admin/js/customize-controls.js
r36837 r36851 1791 1791 }); 1792 1792 1793 // Re-render whenever the control's setting changes. 1794 control.setting.bind( function () { control.renderContent(); } ); 1793 control.setting.bind( function( value ) { 1794 1795 // Send attachment information to the preview for possible use in `postMessage` transport. 1796 wp.media.attachment( value ).fetch().done( function() { 1797 wp.customize.previewer.send( control.setting.id + '-attachment-data', this.attributes ); 1798 } ); 1799 1800 // Re-render whenever the control's setting changes. 1801 control.renderContent(); 1802 } ); 1795 1803 }, 1796 1804 … … 2304 2312 2305 2313 /** 2306 * A control for selecting custom logos.2307 *2308 * @class2309 * @augments wp.customize.MediaControl2310 * @augments wp.customize.Control2311 * @augments wp.customize.Class2312 */2313 api.CustomLogoControl = api.MediaControl.extend({2314 2315 /**2316 * When the control's DOM structure is ready,2317 * set up internal event bindings.2318 */2319 ready: function() {2320 var control = this;2321 2322 // Shortcut so that we don't have to use _.bind every time we add a callback.2323 _.bindAll( control, 'restoreDefault', 'removeFile', 'openFrame', 'select' );2324 2325 // Bind events, with delegation to facilitate re-rendering.2326 control.container.on( 'click keydown', '.upload-button', control.openFrame );2327 control.container.on( 'click keydown', '.thumbnail-image img', control.openFrame );2328 control.container.on( 'click keydown', '.default-button', control.restoreDefault );2329 control.container.on( 'click keydown', '.remove-button', control.removeFile );2330 2331 control.setting.bind( function( attachmentId ) {2332 wp.media.attachment( attachmentId ).fetch().done( function() {2333 wp.customize.previewer.send( 'custom-logo-attachment-data', this.attributes );2334 } );2335 2336 // Re-render whenever the control's setting changes.2337 control.renderContent();2338 } );2339 }2340 });2341 2342 /**2343 2314 * @class 2344 2315 * @augments wp.customize.Control … … 3246 3217 cropped_image: api.CroppedImageControl, 3247 3218 site_icon: api.SiteIconControl, 3248 custom_logo: api.CustomLogoControl,3249 3219 header: api.HeaderControl, 3250 3220 background: api.BackgroundControl, -
trunk/src/wp-includes/class-wp-customize-manager.php
r36838 r36851 218 218 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); 219 219 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); 220 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-custom-logo-control.php' );221 220 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); 222 221 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); … … 1849 1848 $this->register_control_type( 'WP_Customize_Cropped_Image_Control' ); 1850 1849 $this->register_control_type( 'WP_Customize_Site_Icon_Control' ); 1851 $this->register_control_type( 'WP_Customize_Custom_Logo_Control' );1852 1850 $this->register_control_type( 'WP_Customize_Theme_Control' ); 1853 1851 … … 1966 1964 ) ); 1967 1965 1968 $this->add_control( new WP_Customize_ Custom_Logo_Control( $this, 'custom_logo', array(1966 $this->add_control( new WP_Customize_Media_Control( $this, 'custom_logo', array( 1969 1967 'label' => __( 'Logo' ), 1970 1968 'section' => 'title_tagline', 1971 1969 'priority' => 0, 1970 'mime_type' => 'image', 1971 'button_labels' => array( 1972 'select' => __( 'Select logo' ), 1973 'change' => __( 'Change logo' ), 1974 'remove' => __( 'Remove' ), 1975 'default' => __( 'Default' ), 1976 'placeholder' => __( 'No logo selected' ), 1977 'frame_title' => __( 'Select logo' ), 1978 'frame_button' => __( 'Choose logo' ), 1979 ), 1972 1980 ) ) ); 1973 1981 -
trunk/src/wp-includes/js/customize-preview.js
r36837 r36851 235 235 * @since 4.5.0 236 236 */ 237 api.preview.bind( 'custom -logo-attachment-data', function( attachment ) {237 api.preview.bind( 'custom_logo-attachment-data', function( attachment ) { 238 238 var $logo = $( '.custom-logo' ), 239 239 size = $logo.data( 'size' ),
Note: See TracChangeset
for help on using the changeset viewer.