Revisit resize and scroll logic once more

Wait a little longer on initial scroll down. Previous timeout sometimes
triggered before all text is finished rendering.

Remove redundant resize calls.
This commit is contained in:
lilia 2015-02-18 16:54:43 -08:00
parent 7231bcd5ce
commit 07e44ccf21
2 changed files with 1 additions and 3 deletions

View file

@ -45,7 +45,7 @@
setTimeout(function() { setTimeout(function() {
this.view.resize(); this.view.resize();
this.view.scrollToBottom(); this.view.scrollToBottom();
}.bind(this), 0); }.bind(this), 10);
}, },
events: { events: {

View file

@ -28,12 +28,10 @@ var Whisper = Whisper || {};
}, },
scrollToBottom: function() { scrollToBottom: function() {
// TODO: Avoid scrolling if user has manually scrolled up? // TODO: Avoid scrolling if user has manually scrolled up?
this.resize();
this.$el.scrollTop(this.el.scrollHeight); this.$el.scrollTop(this.el.scrollHeight);
}, },
addAll: function() { addAll: function() {
Whisper.ListView.prototype.addAll.apply(this, arguments); // super() Whisper.ListView.prototype.addAll.apply(this, arguments); // super()
this.resize();
this.scrollToBottom(); this.scrollToBottom();
} }
}); });