1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-02 20:29:10 +00:00

Improve detection of modified drafts

If the target tiddler of the draft is missing (as happens after
clicking “new tiddler”), then we count the draft as modified if the
text is not empty.

Also we count the the draft as modified if the draft title has been
changed
This commit is contained in:
Jermolene 2014-11-09 21:46:41 +00:00
parent 5ded01f2c6
commit cea0b74265

View File

@ -1166,9 +1166,9 @@ exports.isDraftModified = function(title) {
var ignoredFields = ["created", "modified", "title", "draft.title", "draft.of"],
origTiddler = this.getTiddler(tiddler.fields["draft.of"]);
if(!origTiddler) {
return true;
return tiddler.fields.text !== "";
}
return !tiddler.isEqual(origTiddler,ignoredFields);
return tiddler.fields["draft.title"] !== tiddler.fields["draft.of"] || !tiddler.isEqual(origTiddler,ignoredFields);
};
/*