[TW5] Conditional Caption

74 views
Skip to first unread message

infurnoape

unread,
Jan 8, 2016, 4:33:09 PM1/8/16
to tiddl...@googlegroups.com
Would it be possible to have a caption field display as an icon if in a tab, but as text if in a dropdown list? My favorites tab displays as a star icon in the sidebar tab, but in the settings tab, just a blank line shows for the caption in the dropdown for default tab in sidebar.



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5

Andrew

unread,
Jan 9, 2016, 4:16:01 AM1/9/16
to TiddlyWiki
OK, well, here is what I did.
I put the following in the caption field: 
<span class="tc-btn-dropdown" title={{$:/language/SideBar/Favorites/Caption}}>{{$:/core/images/star-filled}}</span><span class="tc-favorites-hidden">{{$:/language/SideBar/Favorites/Caption}}</span>
and the following in the stylesheet:
.tc-btn-dropdown + .tc-favorites-hidden {
    display: none;
}
If anyone has any better ideas, please let me know. Here is my new updated version 0.0.8 of Favorites.

Tobias Beer

unread,
Jan 9, 2016, 3:42:24 PM1/9/16
to TiddlyWiki
Hi Andrew,

May I suggest not to use the system tag $:/tags/favorite to make a tiddler is a favorite?
It's just... that looks rather ugly... and should be reserved to system components.
Why not just use a tag called ★ or Favorites?

Also, why hide the favorite button once a tiddler is a favorite,
rather than highlight the button as if active?

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages