mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-29 12:42:16 -05:00
Set focus correctly the other way.
This commit is contained in:
parent
4849929f83
commit
6052aca7b2
@ -24,12 +24,12 @@ module.exports = {
|
|||||||
window.location = '/login';
|
window.location = '/login';
|
||||||
}
|
}
|
||||||
|
|
||||||
app.hasFocus = false;
|
me.hasFocus = false;
|
||||||
$(window).blur(function () {
|
$(window).blur(function () {
|
||||||
app.hasFocus = false;
|
me.hasFocus = false;
|
||||||
});
|
});
|
||||||
$(window).focus(function () {
|
$(window).focus(function () {
|
||||||
app.hasFocus = true;
|
me.hasFocus = true;
|
||||||
});
|
});
|
||||||
window.onbeforeunload = function () {
|
window.onbeforeunload = function () {
|
||||||
if (client.sessionStarted) {
|
if (client.sessionStarted) {
|
||||||
|
@ -159,7 +159,7 @@ module.exports = HumanModel.define({
|
|||||||
addMessage: function (message, notify) {
|
addMessage: function (message, notify) {
|
||||||
message.owner = me.jid.bare;
|
message.owner = me.jid.bare;
|
||||||
|
|
||||||
if (notify && (!this.activeContact || (this.activeContact && !app.hasFocus)) && message.from.bare === this.jid) {
|
if (notify && (!this.activeContact || (this.activeContact && !me.hasFocus)) && message.from.bare === this.jid) {
|
||||||
this.unreadCount++;
|
this.unreadCount++;
|
||||||
app.notifier.show({
|
app.notifier.show({
|
||||||
title: this.displayName,
|
title: this.displayName,
|
||||||
|
Loading…
Reference in New Issue
Block a user