mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-10 03:03:08 -08:00
Refactored autosave mechanism
Previously we were using a message `tw-auto-save-wiki` to trigger an autosave. The message was generated by certain UI actions such as saving a tiddler. The trouble was that the message was being processed before the wiki change event for the accompanying change had had a chance to percolate. The end result was that the dirty indicator was staying lit when using autosave. The new approach abandons the autosave message and instead triggers the autosave in the wiki change event when a relevant change occurs. One happy side effect of these changes is that the dirty indicator now works as expected with the client server edition - ie, when typing in a draft tiddler the dirty indicator will flash briefly, and then clear when the sync mechanism has completed saving the draft.
This commit is contained in:
parent
9d871309c2
commit
13c4e028b1
7 changed files with 16 additions and 42 deletions
|
|
@ -71,8 +71,6 @@ 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";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue