[tw] Re: A slider which closes itself when clicking elsewhere or closing tiddler

2018-02-21 Thread Stephan Hradek
I do not know, how far you followed my exampl, but an easy trick, with 
HTML5 enabled browser is:

1. instead of @.answer @ put around the answers


answerhere


2. change the "hover" in the CSS to "focus"

Now when you click on the anwer, it will get focus, and will be displayed.

You will be able to edit the answer, but this won't be stored. after 
closing and reopening the tiddler, the correct answer will reappear.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/31d36632-64ec-4f3b-96fb-f11cd312e732%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: A slider which closes itself when clicking elsewhere or closing tiddler

2018-02-20 Thread stefct4
Hi,

On Monday, February 19, 2018 at 7:58:01 PM UTC+1, passingby wrote:
>
> What I want is that content should be revealed upon a click, preferably a 
> button. And that it should close itself when I close the tiddler so that 
> next time I open the tiddler again the content should be hidden by default.
>

This is similar to the tiddler info panel which after opening closes itself 
> upon a click anywhere else and is also closed by default when the tiddler 
> is opened again after closing. 


 
Since nobody else has answered, here are two quick "hacks" that might help, 
even if they aren't exactly what you requested and are quite certainly not 
"polished" enough for a public wiki:

1.) Add the answer to the "Info" panel itself:

<$button>
<$action-listops $tiddler="Display Answer" 
$tags="+[append[$:/tags/TiddlerInfo]]"/>
<$action-setfield $tiddler="Display Answer" caption="Answer"/>
<$action-setfield $tiddler="Display Answer" text="{{!!answer}}"/>
<$action-setfield $tiddler="$:/config/TiddlerInfo/Default" text="Display 
Answer"/>
<$action-setfield 
$tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info" 
text="show"/>
Make Changes


After executing this code, you can reveal any content from the "answer" 
field of an individual tiddler by clicking its "Info" button. Disadvantage: 
The "Answer" tab will appear in Info panels of tiddlers that aren't part of 
the quiz, too. 

2.) Use a modal to display the 
answers: https://tiddlywiki.com/#WidgetMessage%3A%20tm-modal

Using a modal is maybe not the prettiest solution, but simple and 
straightforward.

Cheers,

Stef 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bd88d6df-0b37-4acf-a902-fd5f3e03b3d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.