Cable-Desktop/js/views/message_list_view.js
2014-11-24 19:25:03 -08:00

21 lines
488 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);
},
addAll: function() {
Whisper.ListView.prototype.addAll.apply(this, arguments); // super()
this.scrollToBottom();
},
});
})();