Changeset 23283
- Timestamp:
- 01/04/2013 11:29:20 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r23263 r23283 2847 2847 var selection = this.options.selection; 2848 2848 2849 this.model.on( 'change:sizes change:uploading change:caption change:title', this.render, this ); 2849 this.model.on( 'change:sizes change:uploading', this.render, this ); 2850 this.model.on( 'change:title', this._syncTitle, this ); 2851 this.model.on( 'change:caption', this._syncCaption, this ); 2850 2852 this.model.on( 'change:percent', this.progress, this ); 2851 2853 … … 3165 3167 }); 3166 3168 3169 // Ensure settings remain in sync between attachment views. 3170 _.each({ 3171 caption: '_syncCaption', 3172 title: '_syncTitle' 3173 }, function( method, setting ) { 3174 media.view.Attachment.prototype[ method ] = function( model, value ) { 3175 var $setting = this.$('[data-setting="' + setting + '"]'); 3176 3177 if ( ! $setting.length ) 3178 return this; 3179 3180 // If the updated value is in sync with the value in the DOM, there 3181 // is no need to re-render. If we're currently editing the value, 3182 // it will automatically be in sync, suppressing the re-render for 3183 // the view we're editing, while updating any others. 3184 if ( value === $setting.find('input, textarea, select, [value]').val() ) 3185 return this; 3186 3187 return this.render(); 3188 }; 3189 }); 3190 3167 3191 /** 3168 3192 * wp.media.view.Attachment.Library
Note: See TracChangeset
for help on using the changeset viewer.