Remove resize logic in favor of pure css

This commit is contained in:
lilia 2015-02-18 23:09:34 -08:00
parent 07e44ccf21
commit 3292177a96
7 changed files with 32 additions and 16 deletions

View file

@ -40,10 +40,7 @@
this.$el.find('.discussion-container').append(this.view.el); this.$el.find('.discussion-container').append(this.view.el);
this.view.render(); this.view.render();
window.addEventListener('resize', this.view.resize.bind(this.view));
setTimeout(function() { setTimeout(function() {
this.view.resize();
this.view.scrollToBottom(); this.view.scrollToBottom();
}.bind(this), 10); }.bind(this), 10);
}, },

View file

@ -34,7 +34,6 @@
collection : bg.inbox collection : bg.inbox
}).render(); }).render();
window.addEventListener('resize', this.inbox.resize.bind(this.inbox));
window.addEventListener('beforeunload', function () { window.addEventListener('beforeunload', function () {
this.inbox.stopListening(); this.inbox.stopListening();
}.bind(this)); }.bind(this));

View file

@ -41,12 +41,6 @@ var Whisper = Whisper || {};
addAll: function() { addAll: function() {
this.$el.html(''); this.$el.html('');
this.collection.each(this.addOne, this); this.collection.each(this.addOne, this);
this.resize();
},
resize: function() {
var height = window.innerHeight - $('#header').height() - $('#footer').height();
this.$el.css('height', height + 'px');
}, },
render: function() { render: function() {

View file

@ -1,3 +1,10 @@
.conversation {
padding: $header-height 0;
}
.conversation, .discussion-container, .message-list {
height: 100%;
}
.group-update { .group-update {
font-size: smaller; font-size: smaller;

View file

@ -2,10 +2,14 @@
box-sizing: border-box; box-sizing: border-box;
} }
html {
height: 100%;
}
body { body {
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: $header-height 0 0; margin: 0;
font-family: $roboto; font-family: $roboto;
font-size: 14px; font-size: 14px;
} }

View file

@ -1,9 +1,12 @@
.gutter { .gutter {
margin-top: 36px; padding: $header-height 0 0;
} }
.gutter, #contacts {
height: 100%;
}
#contacts { #contacts {
overflow-y: scroll; overflow: auto;
} }
.loading .gutter { .loading .gutter {

View file

@ -16,10 +16,13 @@
* { * {
box-sizing: border-box; } box-sizing: border-box; }
html {
height: 100%; }
body { body {
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: 36px 0 0; margin: 0;
font-family: Roboto, "Helvetica Neue", Arial, Helvetica, sans-serif; font-family: Roboto, "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 14px; } font-size: 14px; }
@ -105,10 +108,13 @@ body {
text-align: center; } text-align: center; }
.gutter { .gutter {
margin-top: 36px; } padding: 36px 0 0; }
.gutter, #contacts {
height: 100%; }
#contacts { #contacts {
overflow-y: scroll; } overflow: auto; }
.contact .number, .contact .checkbox { .contact .number, .contact .checkbox {
display: none; } display: none; }
@ -259,6 +265,12 @@ input.new-message {
.settings-open .settings { .settings-open .settings {
display: block; } display: block; }
.conversation {
padding: 36px 0; }
.conversation, .discussion-container, .message-list {
height: 100%; }
.group-update { .group-update {
font-size: smaller; } font-size: smaller; }