> Therefore I added a hidden span to the PageTemplate to get it
> invoked:
> <span style='display:none' macro='tiddler ToggleMenuGraph'></span>
> - and a systemConfig with the following line:
> config.options.chkHideMenuGraph=true;
> - because I would like to have the hypergraph initially hidden.
> However, this doesn't seem to work and the hypergraph div still shows
> at startup.
If all you want to do is to *set* the initial state based on the
current option value, this little script will do:
[[InitMenuGraph]]
<script>
var mg=document.getElementById('menuGraph');if(!mg)return;
mg.style.display=config.options.chkHideMenuGraph?'none':'block';
</script>
On the other hand, if you want to create an 'onclick' command link
that *toggles* the display state (and remembers it using a TW option
cookie), this script does the job:
[[ToggleMenuGraph]]
<script label="g">
var mg=document.getElementById('menuGraph');if(!mg)return;
config.options.chkHideMenuGraph=mg.style.display!='none';
mg.style.display=config.options.chkHideMenuGraph?'none':'block';
saveOptionCookie('chkHideMenuGraph');
return false;
</script>
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios