You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/js/views/message_list_view.js

24 lines
591 B
JavaScript

var Whisper = Whisper || {};
(function () {
'use strict';
Whisper.MessageListView = Whisper.ListView.extend({
tagName: 'ul',
className: 'discussion',
itemView: Whisper.MessageView,
events: {
'add': 'scrollToBottom',
'update *': 'scrollToBottom'
},
scrollToBottom: function() {
// TODO: Avoid scrolling if user has manually scrolled up?
this.$el.scrollTop(this.el.scrollHeight);
},
addAll: function() {
11 years ago
Whisper.ListView.prototype.addAll.apply(this, arguments); // super()
this.scrollToBottom();
},
});
})();