Changeset 22339
- Timestamp:
- 10/30/2012 11:59:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22338 r22339 1040 1040 this.controller = this.options.controller; 1041 1041 1042 this.model.on( 'change:sizes change:uploading ', this.render, this );1042 this.model.on( 'change:sizes change:uploading change:caption change:title', this.render, this ); 1043 1043 this.model.on( 'change:percent', this.progress, this ); 1044 1044 this.model.on( 'add', this.select, this ); 1045 1045 this.model.on( 'remove', this.deselect, this ); 1046 1046 1047 // Update the model's details view. 1048 this.model.on( 'selection:single selection:unsingle', this.details, this ); 1049 this.details( this.model, this.controller.state().get('selection') ); 1050 1047 1051 // Prevent default navigation on all links. 1048 1052 this.$el.on( 'click', 'a', this.preventDefault ); 1049 1053 }, 1050 1054 1055 destroy: function() { 1056 this.model.off( null, null, this ); 1057 }, 1058 1051 1059 render: function() { 1052 var state = this.controller.state(), 1053 attachment = this.model.toJSON(), 1060 var attachment = this.model.toJSON(), 1054 1061 options = _.defaults( this.model.toJSON(), { 1055 1062 orientation: 'landscape', … … 1064 1071 1065 1072 options.buttons = this.buttons; 1066 options.describe = state.get('describe');1073 options.describe = this.controller.state().get('describe'); 1067 1074 1068 1075 if ( 'image' === options.type ) … … 1080 1087 this.select(); 1081 1088 1082 // Update the model's details view. 1083 this.model.on( 'selection:single selection:unsingle', this.details, this ); 1084 this.details( this.model, state.get('selection') ); 1085 1086 return this; 1087 }, 1088 1089 destroy: function() { 1090 this.model.off( 'single', this.details, this ); 1089 return this; 1091 1090 }, 1092 1091
Note: See TracChangeset
for help on using the changeset viewer.