Hi Mario I agree that it would be useful for toolbar buttons to carry an identifying class, but I'm not sure that I agree with modifying the reveal widget to do it. Why don't we add an extra wrapper with classes such as "tc-toolbar-$:/core/ui/Buttons/close-all"? Perhaps we can discuss at the hangout today?
Best wishes Jeremy On Sat, Oct 4, 2014 at 2:27 PM, PMario <[email protected]> wrote: > @Jeremy, and everyone interested :) > > There is a specific problem with the ReadOnly theme, that causes this > thread. > But the solution I want to have imo is of general interest for theme > creators. The reveal widget assigns the tc-reveal class to many different > elements but without a dynamic more specific class, the tc-reveal alone > isn't very useful. > > > That's the behaviour I want: > Copy this code into a new tiddler. > > \define config-title() > $:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/$(listItem)$ > \end > > \define listItemX() > $:/core/ui/Buttons/$(listItem)$ > \end > > \define classListItem() > tc-toolbar-$(listItem)$ > \end > > <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of] > *removeprefix[$:/core/ui/Buttons/]*]" variable="listItem"><$reveal > type="nomatch" state=<<config-title>> text="hide" > *class=<<classListItem>>* ><$transclude tiddler=<<listItem*X* > >>/></$reveal></$list> > > F12 debug tools > Inspect the icons. > You'll see, that every span has now a tc-toolbar-xxx and tc-reveal class. > (The order should be in reverse but this will be a seperate ticket for > github.) > > So the code is fine, but imo can't be a pull request, because > $:/core/ui/Buttons/ is hard coded several times. > > The default $:/core/ui/ViewTemplate/title looks like this. > > \define config-title() > $:/config/ViewToolbarButtons/Visibility/$(listItem)$ > \end > > <$list > filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]" > variable="listItem"><$reveal type="nomatch" state=<<config-title>> > text="hide" class="*newClassHere*"><$transclude > tiddler=<<listItem>>/></$reveal></$list> > > > So is there a possibility, to remove the $:/core/ui/Buttons/ prefix from > <<listItem>> and add tc-toolbar- instead. So we can make the newClassHere > dynamic, > in the way the first example works. But I only want to have the prefix > handling for the "newClassHere" ... > > have fun! > mario > > > > -- Jeremy Ruston mailto:[email protected] -- 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. For more options, visit https://groups.google.com/d/optout.
