$(window).on('blur', function windowOnBlur() {
var active_panel = that.model.panels().active;
if (active_panel && active_panel.view.updateLastSeenMarker) {
- _kiwi.global.connections.active.view.updateLastSeenMarker();
+ active_panel.view.updateLastSeenMarker();
}
that.has_focus = false;
line_msg = '<div class="msg <%= type %> <%= css_classes %>"><div class="time"><%- time_string %></div><div class="nick" style="<%= nick_style %>"><%- nick %></div><div class="text" style="<%= style %>"><%= msg %> </div></div>';
this.$messages.append($(_.template(line_msg, display_obj)).data('message', msg));
- this.updateLastSeenMarker();
-
// Activity/alerts based on the type of new message
if (msg.type.match(/^action /)) {
this.alert('action');
updateLastSeenMarker: function() {
- var last_seen, last_message;
- if (this.model.isActive() && _kiwi.app.view.has_focus) {
+ if (this.model.isActive()) {
// Remove the previous last seen classes
- last_seen = this.$(".last_seen");
- if (last_seen && last_seen.length) {
- last_seen.removeClass("last_seen");
- }
+ this.$(".last_seen").removeClass("last_seen");
// Mark the last message the user saw
- last_message = this.$messages.children().last();
- if (last_message) {
- last_message.addClass("last_seen");
- }
+ this.$messages.children().last().addClass("last_seen");
}
},