Skip to content

Commit e665618

Browse files
committed
Merge pull request #17 from brechmos/master
make modal disappear on event
2 parents c178e49 + c5d5c63 commit e665618

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dist/bootstrap-session-timeout.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@
9595
if (!opt.ignoreUserActivity) {
9696
$(document).on('keyup mouseup mousemove touchend touchmove', function() {
9797
startSessionTimer();
98+
99+
// If they moved the mouse not only reset the counter
100+
// but remove the modal too!
101+
if( $('#session-timeout-dialog').length > 0 &&
102+
$('#session-timeout-dialog').data('bs.modal').isShown )
103+
{
104+
// http://stackoverflow.com/questions/11519660/twitter-bootstrap-modal-backdrop-doesnt-disappear
105+
$('#session-timeout-dialog').modal('hide');
106+
$('body').removeClass('modal-open');
107+
$('div.modal-backdrop').remove();
108+
109+
}
98110
});
99111
}
100112

0 commit comments

Comments
 (0)