9a0a87ab40
It can be moved if you're not scrolled to the bottom of of the window or the window doesn't have focus when a new message comes in. Other than that, it marches up the window until you close and reopen the conversation, or send a message. Note that we do NOT mark messages as read if they come in when you are scrolled up. But we do mark the entire conversation as read if you switch away from the app and back. FREEBIE
32 lines
814 B
JavaScript
32 lines
814 B
JavaScript
/*
|
|
* vim: ts=4:sw=4:expandtab
|
|
*/
|
|
(function () {
|
|
'use strict';
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
var FIVE_SECONDS = 5 * 1000;
|
|
|
|
Whisper.LastSeenIndicatorView = Whisper.View.extend({
|
|
className: 'last-seen-indicator-view',
|
|
templateName: 'last-seen-indicator-view',
|
|
initialize: function(options) {
|
|
options = options || {};
|
|
this.count = options.count || 0;
|
|
},
|
|
|
|
increment: function(count) {
|
|
this.count += count;
|
|
this.render();
|
|
},
|
|
|
|
render_attributes: function() {
|
|
var unreadMessages = this.count === 1 ? i18n('unreadMessage')
|
|
: i18n('unreadMessages', [this.count]);
|
|
|
|
return {
|
|
unreadMessages: unreadMessages
|
|
};
|
|
}
|
|
});
|
|
})();
|