1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 02:50:27 +00:00

Fix detection of draft changes

We were getting a lot of problems where changes to a tiddler were not
being recognised
This commit is contained in:
Jermolene 2014-06-23 08:10:32 +01:00
parent 680fe41ed7
commit 6d1eaeb0fc

View File

@ -1085,7 +1085,7 @@ exports.readFile = function(file,callback) {
Check whether the specified draft tiddler has been modified
*/
exports.isDraftModified = function(title) {
var tiddler = this.getTiddler(title);
var tiddler = this.getTiddler(title);
if(!tiddler.isDraft()) {
return false;
}
@ -1094,18 +1094,7 @@ exports.isDraftModified = function(title) {
if(!origTiddler) {
return true;
}
if(tiddler.fields["draft.title"] !== tiddler.fields["draft.of"]) {
return true;
}
if(!$tw.utils.isArrayEqual(tiddler.fields.tags,origTiddler.fields.tags)) {
return true;
}
return !Object.keys(tiddler.fields).every(function(field) {
if(ignoredFields.indexOf(field) >= 0) {
return true;
}
return tiddler.fields[field] === origTiddler.fields[field];
});
return !tiddler.isEqual(origTiddler,ignoredFields);
};
/*