Hi Siniy-Kit,

Hi, Tobias. I understood what you mean. I deleted opened tiddler from DOM, 
> and then I try to open it again I saw an empty screen, because navigator.js 
> try to find it in history and make  display:block;, but don't find it. if  
> I don't want to modify core, is it possible to put a little script to the  
> top of the tiddler  and to *run it when tiddler is opened*?
> and I want to close all tiddlers except current [tag[$:/TOC]!is[current]] 
>

Without looking at what you tried exactly and how it's a bit difficult to 
tell what could be done differently.

Assuming you talk about NavigatorWidget.prototype.addToStory() 
<https://github.com/Jermolene/TiddlyWiki5/blob/424b2fea3279c14daac0b0ca2baabc7c8ad7d41e/core/modules/widgets/navigator.js#L116>
 now...

If you only want to remove any tiddlers matching a given filter, you need 
to...

   - perhaps persist that filter as a config somewhere so as to not have it 
   hard-wired in your core modifications
      - read that filter via *remove 
      = $tw.wiki.getTextReference("$:/config/RemoveOnOpenFilter")*
   - run that filter against the store via *tids =* 
   *$tw.wiki.filterTiddlers(remove)*
   - check all items in the history against titles matching that filter
   - splice out only those that match
   - set the history to the spliced one
   - eventually append the title you wanted to open in the first place

Best wishes,

— tb

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/abd63960-a34c-47d6-b537-a33dad003eae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to