Fixes #71 Autoscroll

Conversation view autoscroll triggers on dom change, not storage change,
ensuring that we don't scroll before the new element is inserted.
This commit is contained in:
lilia 2014-11-10 23:16:46 -08:00
parent 13446e9c17
commit 0956d328da
3 changed files with 9 additions and 7 deletions

View file

@ -6,6 +6,12 @@ var Whisper = Whisper || {};
Whisper.MessageListView = Whisper.ListView.extend({
tagName: 'ul',
className: 'discussion',
itemView: Whisper.MessageView
itemView: Whisper.MessageView,
events: {
'add': 'scrollToBottom'
},
scrollToBottom: function() {
this.$el.scrollTop(this.el.scrollHeight);
},
});
})();