Add 'pagehide' to ask confirmation on ipads
This commit is contained in:
parent
d686a756fb
commit
b6d9a3127c
1 changed files with 24 additions and 22 deletions
|
@ -53,8 +53,7 @@ export default class PendingChangesUploader{
|
|||
}
|
||||
|
||||
|
||||
window.onbeforeunload = function(e){
|
||||
|
||||
function onunload(e) {
|
||||
if (changes.pending.data.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -63,8 +62,11 @@ export default class PendingChangesUploader{
|
|||
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)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue