mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 03:33:58 -05:00
Fix idle.js not change isAway property on onAway and onAwayBack events
This commit is contained in:
parent
f69a5361cb
commit
3a5bda3067
1 changed files with 12 additions and 10 deletions
|
@ -685,8 +685,18 @@ var spinner = new Spinner(opts).spin(ui.spinner[0]);
|
||||||
|
|
||||||
//idle
|
//idle
|
||||||
var idle = new Idle({
|
var idle = new Idle({
|
||||||
onAway: idleStateChange,
|
onAway: function () {
|
||||||
onAwayBack: idleStateChange,
|
idle.isAway = true;
|
||||||
|
emitUserStatus();
|
||||||
|
updateOnlineStatus();
|
||||||
|
},
|
||||||
|
onAwayBack: function () {
|
||||||
|
idle.isAway = false;
|
||||||
|
emitUserStatus();
|
||||||
|
updateOnlineStatus();
|
||||||
|
setHaveUnreadChanges(false);
|
||||||
|
updateTitleReminder();
|
||||||
|
},
|
||||||
awayTimeout: idleTime
|
awayTimeout: idleTime
|
||||||
});
|
});
|
||||||
ui.area.codemirror.on('touchstart', function () {
|
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) {
|
function setRefreshModal(status) {
|
||||||
$('#refreshModal').modal('show');
|
$('#refreshModal').modal('show');
|
||||||
$('#refreshModal').find('.modal-body > div').hide();
|
$('#refreshModal').find('.modal-body > div').hide();
|
||||||
|
|
Loading…
Reference in a new issue