mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-12-01 13:42:16 -05:00
Reset unread count for active contact on focus.
This commit is contained in:
parent
ea08b54e03
commit
bec2387801
@ -1,4 +1,4 @@
|
|||||||
/*global app, $*/
|
/*global app, $, me*/
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var HumanModel = require('human-model');
|
var HumanModel = require('human-model');
|
||||||
@ -11,11 +11,15 @@ module.exports = HumanModel.define({
|
|||||||
});
|
});
|
||||||
$(window).focus(function () {
|
$(window).focus(function () {
|
||||||
self.focused = true;
|
self.focused = true;
|
||||||
|
if (me._activeContact) {
|
||||||
|
me.setActiveContact(me._activeContact);
|
||||||
|
}
|
||||||
self.markActive();
|
self.markActive();
|
||||||
});
|
});
|
||||||
if (window.macgap) {
|
if (window.macgap) {
|
||||||
document.addEventListener('sleep', function () {
|
document.addEventListener('sleep', function () {
|
||||||
clearTimeout(this.idleTimer);
|
clearTimeout(this.idleTimer);
|
||||||
|
console.log('went to sleep');
|
||||||
self.markInactive();
|
self.markInactive();
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user