diff options
Diffstat (limited to '')
-rw-r--r-- | public/js/index.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/public/js/index.js b/public/js/index.js index 919626c2..3ad16e45 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -685,8 +685,18 @@ var spinner = new Spinner(opts).spin(ui.spinner[0]); //idle var idle = new Idle({ - onAway: idleStateChange, - onAwayBack: idleStateChange, + onAway: function () { + idle.isAway = true; + emitUserStatus(); + updateOnlineStatus(); + }, + onAwayBack: function () { + idle.isAway = false; + emitUserStatus(); + updateOnlineStatus(); + setHaveUnreadChanges(false); + updateTitleReminder(); + }, awayTimeout: idleTime }); ui.area.codemirror.on('touchstart', function () { @@ -713,14 +723,6 @@ function updateTitleReminder() { } } -function idleStateChange() { - emitUserStatus(); - updateOnlineStatus(); - if (!idle.isAway) - setHaveUnreadChanges(false); - updateTitleReminder(); -} - function setRefreshModal(status) { $('#refreshModal').modal('show'); $('#refreshModal').find('.modal-body > div').hide(); |