Since you have an empty cookie allready, it will be needed to delete it. On 9 Sep., 10:08, PMario <[email protected]> wrote: > copy this into a tiddler eg: SliderCookieHack and tag it systemConfig > > //{{{ > config.macros.slider.onClickSlider = function(ev) > { > var e = ev || window.event; > var n = this.nextSibling; > var cookie = n.getAttribute("cookie"); > var isOpen = n.style.display != "none"; > if(config.options.chkAnimate && anim && typeof Slider == "function") > anim.startAnimating(new Slider(n,!isOpen,null,"none")); > else > n.style.display = isOpen ? "none" : "block"; > if (cookie != "") { //!! > config.options[cookie] = !isOpen; > saveOptionCookie(cookie); > } //!! > return false;}; > > //}}} > > If the list breaks the lines, you can load from TeamWork [1] > I did a short test. Please report if there are some side effects!! > > [1]http://hoster.peermore.com/recipes/TeamWork/tiddlers.wiki#SliderCooki... > > On 8 Sep., 11:02, Matt Flower <[email protected]> wrote: > > > I have a problem with the <slider> macro in TiddlyWiki 2.6.0. I could > > probably fix it by overriding the macro, but as it is in the Core code > > I don't really want to touch it so I am raising it here. > > > I use sliders to hide sections of content, and in my early prototypes > > gave each slider a unique identity, which was a pain with over 1000 > > tiddlers and something like 3000 sliders. > > > The required behaviour is that the sliders always default to closed > > and it all appeared to be working fine > > > I then realised that this was creating a very large number of cookie > > entries and that on some tiddlers sliders were appearing in the open > > position. So I modified the generation so that the identity was "" > > thinking that without a name the state wouldn't be saved. > > > But I was wrong - what now happens is that if you open a single > > slider, then all sliders on any tiddlers opened afterwards are > > automatically opened, until you close one, then all sliders will be > > closed. Basically all of my sliders are now sharing the same stored > > value even though the name is a zero length string. The state is only > > looked up when a tiddler is opened it is not that they all open and > > close together. > > > Would it be possible to alter the TiddlyWiki code such that if the > > identity for a slider (or anything else) is a zero length string, then > > the value is not stored and recalled? If makes more sense to me as if > > I wanted it to be saved I would name it. > > > Thanks > > > Matt > >
-- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
