diff options
author | Wu Cheng-Han | 2016-07-30 11:32:19 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-07-30 11:32:19 +0800 |
commit | 3a5bda306734141e15131b20d96aeb67f80760ce (patch) | |
tree | 6177e9e1207d7137d47225d2e49a0bac2cc480f7 /public/js | |
parent | f69a5361cbbc81a78a7b6a6a623dea0700f84d44 (diff) |
Fix idle.js not change isAway property on onAway and onAwayBack events
Diffstat (limited to 'public/js')
-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(); |