aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2025-03-28 10:49:43 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2025-03-28 11:50:51 +0100
commitd2b0799fe31c93cb0f21109d2a0e14fec578ca42 (patch)
treee58515b688c247950184d888458a05ef1904eed0 /resources
parentc3f3b837e68be655cdd0314739c59cc1e98c6eb7 (diff)
Resolve "Unload event listeners are deprecated and will be removed."
Closes #5436 Merge request studip/studip!4076
Diffstat (limited to 'resources')
-rw-r--r--resources/assets/javascripts/bootstrap/jsupdater.js2
-rw-r--r--resources/assets/javascripts/lib/dialog.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/resources/assets/javascripts/bootstrap/jsupdater.js b/resources/assets/javascripts/bootstrap/jsupdater.js
index 9fbcd0e..8434413 100644
--- a/resources/assets/javascripts/bootstrap/jsupdater.js
+++ b/resources/assets/javascripts/bootstrap/jsupdater.js
@@ -7,4 +7,4 @@ $(window).on('load', function() {
// Try to stop js updater if window is unloaded (might not work in all
// browsers)
-$(window).on('unload', STUDIP.JSUpdater.stop);
+$(window).on('beforeunload', STUDIP.JSUpdater.stop);
diff --git a/resources/assets/javascripts/lib/dialog.js b/resources/assets/javascripts/lib/dialog.js
index 8b46cb6..7517d9c 100644
--- a/resources/assets/javascripts/lib/dialog.js
+++ b/resources/assets/javascripts/lib/dialog.js
@@ -115,7 +115,7 @@ Dialog.handlers.header['X-Location'] = function(location, options) {
.on('hashchange', function() {
document.location.reload(true);
})
- .on('unload', function() {
+ .on('beforeunload', function() {
$(window).off('hashchange');
});
}