From 07e44ccf2111fb86dcfd6f540749715d74ef3e02 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 18 Feb 2015 16:54:43 -0800 Subject: [PATCH] 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. --- js/views/conversation_view.js | 2 +- js/views/message_list_view.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 0c190244..dc3aaaff 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -45,7 +45,7 @@ setTimeout(function() { this.view.resize(); this.view.scrollToBottom(); - }.bind(this), 0); + }.bind(this), 10); }, events: { diff --git a/js/views/message_list_view.js b/js/views/message_list_view.js index a3d1990c..9b18dc36 100644 --- a/js/views/message_list_view.js +++ b/js/views/message_list_view.js @@ -28,12 +28,10 @@ var Whisper = Whisper || {}; }, scrollToBottom: function() { // TODO: Avoid scrolling if user has manually scrolled up? - this.resize(); this.$el.scrollTop(this.el.scrollHeight); }, addAll: function() { Whisper.ListView.prototype.addAll.apply(this, arguments); // super() - this.resize(); this.scrollToBottom(); } });