1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-01 22:38:08 +00:00

Move the unsaved changes warning into the syncer

This commit is contained in:
Jermolene
2014-08-13 19:29:00 +01:00
parent 57ab9f6167
commit c9ce606b7c
2 changed files with 11 additions and 9 deletions

View File

@@ -54,15 +54,6 @@ exports.startup = function() {
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});
// Host-specific startup
if($tw.browser) {
// Set up our beforeunload handler
window.addEventListener("beforeunload",function(event) {
var confirmationMessage = undefined;
if($tw.syncer.isDirty()) {
confirmationMessage = $tw.language.getString("UnsavedChangesWarning");
event.returnValue = confirmationMessage; // Gecko
}
return confirmationMessage;
});
// Install the popup manager
$tw.popup = new $tw.utils.Popup({
rootElement: document.body