1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-22 19:27:40 +00:00

Fix for autosave

Re-introduces the “tw-auto-save-wiki” message. The previous approach of
automatically triggering autosave whenever a tiddler changed meant that
changing configuration changes in control panel was triggering an
autosave. Using the explicit message gives us better control of the
situations in which we’ll autosave.

Now we solve the earlier problem of there being outstanding tiddler
change events at the time that we process the “tw-auto-save-wiki” by
deferring the autosave until the outstanding change event comes in.
This commit is contained in:
Jermolene
2014-08-29 09:58:30 +01:00
parent 48312272ad
commit 2952afe7af
5 changed files with 155 additions and 121 deletions

View File

@@ -71,6 +71,8 @@ exports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {
$tw.wiki.deleteTiddler(title);
}
});
// Trigger an autosave
$tw.rootWidget.dispatchEvent({type: "tw-auto-save-wiki"});
// Return a heartwarming confirmation
return "Plugin " + title + " successfully saved";
}