Ticket #31742: 31742.2.diff
File 31742.2.diff, 1.1 KB (added by , 10 years ago) |
---|
-
wp-includes/js/customize-views.js
105 105 }, 106 106 107 107 initialize: function() { 108 var properties = [109 this.model.get('header').url,110 this.model.get('choice')111 ];112 113 108 this.listenTo(this.model, 'change:selected', this.toggleSelected); 114 109 115 if ( _.contains(properties, api.get().header_image)) {110 if ( this.isCurrentHeader() ) { 116 111 api.HeaderTool.currentHeader.set(this.extendedModel()); 117 112 } 118 113 }, 119 114 115 isCurrentHeader: function() { 116 var currentHeaderId = api.get().header_image_data.attachment_id; 117 if ( currentHeaderId && this.model.get( 'header' ).attachment_id === currentHeaderId ) { 118 return true; 119 } 120 if ( ! currentHeaderId && _.contains( [ this.model.get( 'choice' ), this.model.get( 'header' ).url ], api.get().header_image ) ) { 121 return true; 122 } 123 return false; 124 }, 125 120 126 render: function() { 121 127 this.$el.html(this.template(this.extendedModel())); 122 128