I am making a sort of tabbed interface for a Tiddlywiki, and I am wondering how to get this code to fire every time a tiddler is opened or closed. Tiddlywiki is an HTML notebook type of thing that runs in the browser, and a tiddler is a div in #tiddlerDisplay
. There can be, and usually are, more than one in it at a time.
The divs I want to list are contained in #tiddlerDisplay
, and the list itself is jQuery("#mainMenu > #singleTiddlerList")
.
config.macros.singleTiddler.update = function(){
jQuery("#mainMenu > #singleTiddlerList").empty();
jQuery("#tiddlerDisplay > div").each(function(i,e){
jQuery("#mainMenu > #singleTiddlerList").append(jQuery(
createTiddlyButton(document.createElement("li"),jQuery(e).attr("tiddler"),"",config.macros.singleTiddler.clickHandler)
).parent());
});
};
Update: I can't just add a custom event, unless I can do it from outside the current code (such as something that fires on document load).