signal-desktop/js/views/last_seen_indicator_view.js
Scott Nonnenberg 672a517b73 Preserve lastSeenIndicator location when not focused
Also, a couple name changes of ConversationView methods to better
reflect what they do. update -> reset, since the method is destructive.

FREEBIE
2017-06-01 16:09:27 -07:00

36 lines
888 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();
},
getCount: function() {
return this.count;
},
render_attributes: function() {
var unreadMessages = this.count === 1 ? i18n('unreadMessage')
: i18n('unreadMessages', [this.count]);
return {
unreadMessages: unreadMessages
};
}
});
})();