Maybe I'm wrong, but I think that in JS any object is immutable. If you
read my solution, what I'm actually doing is creating a new tiddler using
the tiddler object as argument.
Going back to my solution, this is what I'm doing right now.
var tiddler=this.wiki.getTiddler(this.clearTiddler);
> if(tiddler){
> var defaultFields=["created", "modified", "tags", "title", "type"];
> for(var field in tiddler.fields){
> if(defaultFields.indexOf(field)<0)
> tiddler.fields[field]="";
> }
> this.wiki.addTiddler(tiddler);
> }
This looks horrible to me, and I'm looking for a better solution if
possible.
El miércoles, 2 de abril de 2014 20:08:57 UTC+2, PMario escribió:
>
> On Wednesday, April 2, 2014 5:05:49 PM UTC+2, Danielo Rodríguez wrote:
>>
>> I tried with
>>
>> var tiddler=this.wiki.getTiddler(this.clearTiddler);
>> if(tiddler){
>> tiddler.fields.text="";
>>
>
> IMO with the upcoming version this will not be possible anymore, since
> tthe tiddler object will be imutable.
> https://github.com/Jermolene/TiddlyWiki5/blob/master/boot/boot.js#L753
>
> -m
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.