Hi Yakov,
I believe closing the current tiddler first and then opening the new one
fixes the problem.
*TiddlyLinkClosingCurrentTiddlerPlugin*
*
*
> /***
> |''Name''|TiddlyLinkClosingCurrentTiddlerPlugin|
> |''Description''|closes the current tiddler when clicking a tiddlyLink
> holding the shift key|
> |''Author''|[[Yakov|your.profile.or.site.com]]|
|''Version''|1.0|
> |''Source''|add.your.path.here/like/github|
> ***/
> //{{{
> onClickTiddlerLinkWithoutShiftKey = onClickTiddlerLink;
> onClickTiddlerLink = function(ev) {
> if(ev.shiftKey) {
> var tid = story.findContainingTiddler(this);
> if(tid) {
> story.closeTiddler(tid.getAttribute("tiddler"));
> }
> }
> return onClickTiddlerLinkWithoutShiftKey(ev);
> }
> //}}}
Also note, I have put the hijacked function into a global variable. This
allows later introspection with respect to what has been replaced, which
would otherwise no longer be accessible other than in the context of your
replacement function.
http://tiddlywikidev.tiddlyspace.com/#Hijacking
Cheers, Tobias.
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.