Add then Remove. Cool thanks. I though there was something like that.

On Thursday, January 21, 2016 at 12:31:43 PM UTC-5, Felix Küppers wrote:
>
> Hi Devin,
>
> you need to create a new tiddler based on the old tiddler and also 
> override the "tags" field, also you need to clone the array to work with it 
> using slice. The $tw.Tiddler() constructor accepts tiddler objects as 
> arguments and "hashmaps" so just do the following (off the top of my head):
>
> var copyOfArray = myOldTiddlerWhichIsFrozen.fields.tags.slice(0)
>
> do your array stuff and then:
>
> var fields = {
>   tags: myChangedArray
> };
>
> var mod = $tw.Tiddler(myOldTiddlerWhichIsFrozen, fields);
>
> then add this tiddler to the store using $tw.wiki.addTiddler(mod)
>
> -Felix
>
> On 01/21/2016 06:00 PM, Devin Weaver wrote:
>
> I have a plugin that takes a tiddler which has a known tag and I want to 
> remove that tag from the tiddler.
>
> I found out the hard way that tiddler.fields.tags is frozen so I can not 
> filter or slice it.
>
> Is there a function in the core that will remove / add tags to a tiddler?
> -- 
> 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] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit 
> <https://groups.google.com/d/msgid/tiddlywikidev/6a8165b6-d528-41b3-9c5c-0601df4990a9%40googlegroups.com?utm_medium=email&utm_source=footer>
> https://groups.google.com/d/msgid/tiddlywikidev/6a8165b6-d528-41b3-9c5c-0601df4990a9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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 https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/0c08bde3-ef31-4be2-b861-5bea3c36fb59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to