1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-29 04:32:15 -05:00

Reset unread count for active contact on focus.

This commit is contained in:
Lance Stout 2013-09-27 12:05:39 -07:00
parent ea08b54e03
commit bec2387801

View File

@ -1,4 +1,4 @@
/*global app, $*/
/*global app, $, me*/
"use strict";
var HumanModel = require('human-model');
@ -11,11 +11,15 @@ module.exports = HumanModel.define({
});
$(window).focus(function () {
self.focused = true;
if (me._activeContact) {
me.setActiveContact(me._activeContact);
}
self.markActive();
});
if (window.macgap) {
document.addEventListener('sleep', function () {
clearTimeout(this.idleTimer);
console.log('went to sleep');
self.markInactive();
}, true);
}