1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 19:10:28 +00:00

Fixed problem with deleting fields in the Tiddler constructor

This commit is contained in:
Jeremy Ruston 2012-04-10 14:37:52 +01:00
parent 0c824f3ce7
commit 6479fff012

View File

@ -34,9 +34,14 @@ var Tiddler = function(/* tiddler,fields */) {
src = arg;
}
for(t in src) {
f = Tiddler.parseTiddlerField(t,src[t]);
if(f !== null) {
fields[t] = f;
if(src[t] === undefined) {
// If we get a field that's undefined, delete any previous field value
delete fields[t];
} else {
f = Tiddler.parseTiddlerField(t,src[t]);
if(f !== null) {
fields[t] = f;
}
}
}
}