Add 'pagehide' to ask confirmation on ipads

This commit is contained in:
pietervdvn 2021-07-03 14:48:07 +02:00
parent d686a756fb
commit b6d9a3127c

View file

@ -53,8 +53,7 @@ export default class PendingChangesUploader{
} }
window.onbeforeunload = function(e){ function onunload(e) {
if (changes.pending.data.length == 0) { if (changes.pending.data.length == 0) {
return; return;
} }
@ -63,8 +62,11 @@ export default class PendingChangesUploader{
return "Saving your last changes..." return "Saving your last changes..."
} }
} window.onbeforeunload = onunload
// https://stackoverflow.com/questions/3239834/window-onbeforeunload-not-working-on-the-ipad#4824156
window.addEventListener("pagehide", onunload)
}
} }