Hi Matt

> I would like to implement a function into my TiddlyWiki in which clicking on 
> an already-opened tab closes it. I'm kind of stuck and was wondering if I 
> could get some advice. Or if someone has already done this let me know. :)

It sounds like you’re getting into TiddlyWiki quite deeply now :)

> As far as I understand, I need to send a message to $:/state/tab/sidebar (or 
> whatever state) to delete its content if it matches the tab that was just 
> clicked. The problem is I am having trouble figuring out where the code is 
> that defines what actions are taken when the user clicks a tab.

Good stuff; your reasoning about the use of the state tiddler is correct. At 
the moment, clicking on a tab sets the state tiddler to the title of the 
tiddler holding the content of the tab. You’ll need to add a condition, 
clearing the state tiddler if it is already set to the current tab.

The core “tabs” macro is defined in this tiddler:

http://tiddlywiki.com/#%24%3A%2Fcore%2Fmacros%2Ftabs 
<http://tiddlywiki.com/#$:/core/macros/tabs>

The tiddler appears blank in view mode; click the edit button to see the 
content.

Now, the change you want to make actually goes pretty deep; it touches the most 
fundamental part of the logic of the tabs macro: what happens when you click on 
a tab. Making the change requires understanding how the tabs macro currently 
works. I’m afraid I don’t have time right now to code it for you; if nobody 
else here steps up, you might have to figure it out yourself by studying the 
existing code.

Best wishes

Jeremy


> 
> 
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywikidev 
> <https://groups.google.com/group/tiddlywikidev>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywikidev/a0ab2f9b-26af-4846-a801-bf940a875142%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywikidev/a0ab2f9b-26af-4846-a801-bf940a875142%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <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/B8CC04EB-3EC3-4AC4-BB45-BF81EE48A170%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to