Ticket #36521: 36521.diff
File 36521.diff, 1018 bytes (added by , 7 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
1796 1796 1797 1797 control.setting.bind( function( value ) { 1798 1798 1799 var attachmentNeedsUpdating = control.params.attachment.id != value; 1800 1799 1801 // Send attachment information to the preview for possible use in `postMessage` transport. 1800 1802 wp.media.attachment( value ).fetch().done( function() { 1801 1803 wp.customize.previewer.send( control.setting.id + '-attachment-data', this.attributes ); 1804 1805 if ( attachmentNeedsUpdating ) { 1806 control.params.attachment = this.attributes; 1807 control.renderContent(); 1808 } 1802 1809 } ); 1803 1810 1804 // Re-render whenever the control's setting changes. 1805 control.renderContent(); 1811 if ( ! attachmentNeedsUpdating ) { 1812 // Re-render whenever the control's setting changes. 1813 control.renderContent(); 1814 } 1806 1815 } ); 1807 1816 }, 1808 1817