Skip to content

Commit

Permalink
stop spoor from handling beforeunload if either browser prompt settin…
Browse files Browse the repository at this point in the history
…g is enabled (fixes #10)
  • Loading branch information
moloko committed Mar 1, 2019
1 parent 89f5b13 commit 38c2417
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-close",
"version": "1.1.0",
"version": "1.1.1",
"framework": ">=2.0.4",
"displayName": "Close",
"extension": "close",
Expand Down
1 change: 1 addition & 0 deletions js/adapt-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ define([ 'core/js/adapt' ], function(Adapt) {
}

if (config.browserPromptIfIncomplete || config.browserPromptIfComplete) {
$(window).off('beforeunload');// stop spoor from handling beforeunload - if it handles the event first, LMSFinish will get called regardless of what the user selects in the prompt
$(window).on('beforeunload.close', _.partial(onBeforeUnload, config));
}
}
Expand Down

0 comments on commit 38c2417

Please sign in to comment.