|
|
@ -23,6 +23,7 @@
|
|
|
|
initialize: function() {
|
|
|
|
initialize: function() {
|
|
|
|
this.listenTo(this.model, 'change:body change:errors', this.render);
|
|
|
|
this.listenTo(this.model, 'change:body change:errors', this.render);
|
|
|
|
this.listenTo(this.model, 'change:delivered', this.renderDelivered);
|
|
|
|
this.listenTo(this.model, 'change:delivered', this.renderDelivered);
|
|
|
|
|
|
|
|
this.listenTo(this.model, 'change', this.renderPending);
|
|
|
|
this.listenTo(this.model, 'change:flags change:group_update', this.renderControl);
|
|
|
|
this.listenTo(this.model, 'change:flags change:group_update', this.renderControl);
|
|
|
|
this.listenTo(this.model, 'destroy', this.remove);
|
|
|
|
this.listenTo(this.model, 'destroy', this.remove);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -35,6 +36,11 @@
|
|
|
|
className: function() {
|
|
|
|
className: function() {
|
|
|
|
return ["entry", this.model.get('type')].join(' ');
|
|
|
|
return ["entry", this.model.get('type')].join(' ');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
renderPending: function() {
|
|
|
|
|
|
|
|
if (this.model.isOutgoing()) {
|
|
|
|
|
|
|
|
this.$el.toggleClass('pending', !!this.model.get('pending'));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
renderDelivered: function() {
|
|
|
|
renderDelivered: function() {
|
|
|
|
if (this.model.get('delivered')) { this.$el.addClass('delivered'); }
|
|
|
|
if (this.model.get('delivered')) { this.$el.addClass('delivered'); }
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -66,6 +72,7 @@
|
|
|
|
content.html(this.autoLink(content.html()));
|
|
|
|
content.html(this.autoLink(content.html()));
|
|
|
|
|
|
|
|
|
|
|
|
this.renderDelivered();
|
|
|
|
this.renderDelivered();
|
|
|
|
|
|
|
|
this.renderPending();
|
|
|
|
this.renderControl();
|
|
|
|
this.renderControl();
|
|
|
|
|
|
|
|
|
|
|
|
this.$('.attachments').append(
|
|
|
|
this.$('.attachments').append(
|
|
|
|