Fixed fastforwarding closing videos' fullscreen mode
This commit stops the MessageView from adding the attachment more than once. Previously an attachment was appended to the MessageView every time an update event was emitted, which happens when forwarding. // FREEBIE
This commit is contained in:
parent
c1b8ff9e54
commit
2870c1fff2
1 changed files with 5 additions and 3 deletions
|
@ -153,9 +153,11 @@
|
|||
this.model.get('attachments').forEach(function(attachment) {
|
||||
var view = new Whisper.AttachmentView({ model: attachment });
|
||||
this.listenTo(view, 'update', function() {
|
||||
this.trigger('beforeChangeHeight');
|
||||
this.$('.attachments').append(view.el);
|
||||
this.trigger('afterChangeHeight');
|
||||
if(!view.el.parentNode) {
|
||||
this.trigger('beforeChangeHeight');
|
||||
this.$('.attachments').append(view.el);
|
||||
this.trigger('afterChangeHeight');
|
||||
}
|
||||
});
|
||||
view.render();
|
||||
}.bind(this));
|
||||
|
|
Loading…
Reference in a new issue