Fix: Show attachment views; they trigger update syncrhonously

FREEBIE
pull/749/head
Scott Nonnenberg 8 years ago
parent 5afc16da06
commit 24174312b9

@ -208,7 +208,7 @@
this.update(); this.update();
}, },
renderFileView: function() { renderFileView: function() {
this.view = new FileView({ this.fileView = new FileView({
model: { model: {
mediaType: this.mediaType(), mediaType: this.mediaType(),
fileName: this.displayName(), fileName: this.displayName(),
@ -217,8 +217,8 @@
} }
}); });
this.view.$el.appendTo(this.$el.empty()); this.fileView.$el.appendTo(this.$el.empty());
this.view.render(); this.fileView.render();
return this; return this;
}, },
update: function() { update: function() {

@ -295,13 +295,14 @@
model: attachment, model: attachment,
timestamp: this.model.get('sent_at') timestamp: this.model.get('sent_at')
}); });
view.render();
this.loadedAttachments.push(view); this.loadedAttachments.push(view);
this.listenTo(view, 'update', function() { this.listenTo(view, 'update', function() {
view.updated = true; view.updated = true;
this.appendAttachmentView(view); this.appendAttachmentView(view);
}); });
view.render();
}.bind(this)); }.bind(this));
} }
}); });

Loading…
Cancel
Save