Merge pull request #1288 from umap-project/clean-onbeforeunload

Remove custom message from onbeforeunload event
This commit is contained in:
Yohan Boniface 2023-08-29 17:52:11 +02:00 committed by GitHub
commit 2986e8cec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -267,13 +267,7 @@ L.U.Map.include({
if (L.Util.queryString('download')) this.download()
})
window.onbeforeunload = (e) => {
const msg = L._('You have unsaved changes.')
if (self.isDirty) {
e.returnValue = msg
return msg
}
}
window.onbeforeunload = () => this.isDirty || null
this.backup()
this.initContextMenu()
this.on('click contextmenu.show', this.closeInplaceToolbar)