0956d328da
Conversation view autoscroll triggers on dom change, not storage change, ensuring that we don't scroll before the new element is inserted.
17 lines
352 B
JavaScript
17 lines
352 B
JavaScript
var Whisper = Whisper || {};
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
Whisper.MessageListView = Whisper.ListView.extend({
|
|
tagName: 'ul',
|
|
className: 'discussion',
|
|
itemView: Whisper.MessageView,
|
|
events: {
|
|
'add': 'scrollToBottom'
|
|
},
|
|
scrollToBottom: function() {
|
|
this.$el.scrollTop(this.el.scrollHeight);
|
|
},
|
|
});
|
|
})();
|