Skip to content

Hiding/Showing part of a tiddler when transcluded with widget #5715

Answered by welford
welford asked this question in Q&A
Discussion options

You must be logged in to vote

code here: https://github.com/welford/twsr
example here: http://welford.github.io/kanji.html

I went with a second tiddler that exists in the same space as my "reveal answer"/scheduling plugin. The scheduling plugin has a couple of globals (g_showAnswer, g_questionElm) that when set can be filled by the barebones Question plugin (see code below) and rendered by the scheduling plugin.

var TWSRQuestion = function(parseTreeNode,options) {
	this.initialise(parseTreeNode, options);
};

//Inherit from the base widget class
TWSRQuestion.prototype = new Widget();

/*
Render this widget into the DOM
*/
TWSRQuestion.prototype.render = function(parent,nextSibling) {
	if(g_showAnswer){
		g_questionElm…

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@welford
Comment options

@saqimtiaz
Comment options

@welford
Comment options

@welford
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by welford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants