Open yuginng opened 9 years ago
I found the same issue when ignoreUserActivity === true it seems the keep alives only fire then when the user is active. Also. not sure of the point of the ignoreUserActivity === as whenever I attempt to do something with the dialog that is being displayed my activity dismisses it. Kind of pointless to offer up a couple of buttons for a user to take action if you dismiss the dialog before they can.
If you want to keep the modal up on mouse move just remove these lines (starts at line 110ish):
// If they moved the mouse not only reset the counter
// but remove the modal too!
if ($('#session-timeout-dialog').length > 0 &&
$('#session-timeout-dialog').data('bs.modal') &&
$('#session-timeout-dialog').data('bs.modal').isShown) {
// http://stackoverflow.com/questions/11519660/twitter-bootstrap-modal-backdrop-doesnt-disappear
$('#session-timeout-dialog').modal('hide');
$('body').removeClass('modal-open');
$('div.modal-backdrop').remove();
}
Actually if you add the following code above this block (and prior to startSessionTimer();
if(e.type === 'mousemove' && $('div.modal-backdrop').length > 0) { return; }
This will ensure that mouse movements will not remove the existing modal window.
Hi, Thanks for the excellent plugin. Keep alive does not seem to run even though these options were set: keepAlive: true, keepAliveInterval: 10000,
Adding a call to keepAlive() in the timeout function solved the problem: