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:51:23 +0100
commit3b9c93a7ce424521e05e392fee0df8cc3b2798a1 (patch)
treef11f2926553672b1d03afd2b221b9f54ec8a87e4 /resources
parentb60d7096fc5de8be6b44004701fc5125de87264e (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 65e9574..a3cb639 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');
});
}