Restyle attachment previews

Closes #380

// FREEBIE
This commit is contained in:
lilia 2015-10-29 18:19:51 -07:00
parent fe2b152186
commit 78a2b74297
6 changed files with 72 additions and 34 deletions

View file

@ -31,7 +31,7 @@
this.appWindow = options.appWindow;
this.fileInput = new Whisper.FileInputView({
el: this.$('.attachments'),
el: this.$('form.send'),
window: this.appWindow.contentWindow
});
@ -225,13 +225,20 @@
window.autosize(this.$messageField);
var $discussionContainer = this.$('.discussion-container'),
$conversationHeader = this.$('.conversation-header'),
$attachmentPreviews = this.$('.attachment-previews'),
$bottomBar = this.$('.bottom-bar');
$bottomBar.outerHeight(this.$messageField.outerHeight() + 1);
$bottomBar.outerHeight(
this.$messageField.outerHeight() +
$attachmentPreviews.outerHeight() + 1);
var $bottomBarNewHeight = $bottomBar.outerHeight();
//TODO: revisit this logic for new layout.
$discussionContainer.outerHeight(this.$el.outerHeight() - $bottomBarNewHeight - this.$('.conversation-header').outerHeight() - 20);
$discussionContainer.outerHeight(
this.$el.outerHeight() -
$bottomBarNewHeight -
$conversationHeader.outerHeight() - 20);
this.view.scrollToBottomIfNeeded();
},

View file

@ -46,6 +46,9 @@
this.$('.avatar').hide();
this.thumb.src = src;
this.$('.attachment-previews').append(this.thumb.render().el);
this.thumb.$('img')[0].onload = function() {
this.$el.trigger('force-resize');
}.bind(this);
},
autoScale: function(file) {
@ -216,6 +219,7 @@
}
this.thumb.remove();
this.$('.avatar').show();
this.$el.trigger('force-resize');
},
deleteFiles: function(e) {