21 lines
488 B
JavaScript
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();
|
|
},
|
|
});
|
|
})();
|