[TW5] Reveal edit button template on dirty wiki

90 views
Skip to first unread message

infurnoape

unread,
May 13, 2016, 11:10:35 PM5/13/16
to tiddl...@googlegroups.com
I'm trying to create an edit button template that doesn't reveal unless the wiki is dirty. Any suggestions?


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

Jeremy Ruston

unread,
May 14, 2016, 10:59:49 AM5/14/16
to tiddl...@googlegroups.com
Hi Infurnoape

I'm trying to create an edit button template that doesn't reveal unless the wiki is dirty. Any suggestions?
The dirty state of the wiki isn't stored in a tiddler for the simple reason that if it were, setting the dirty state would change the dirty state recursively. Instead, the dirty state is tracked as a "tc-dirty" class applied to the body tag.

So, you should be able to use a CSS definition to hide stuff:

body.tc-dirty .my-thing {
 display: block;
}

Best wishes

Jeremy



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

--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@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/2jod0282t7fhkpf7ocadt760.1463187074712%40email.android.com.
For more options, visit https://groups.google.com/d/optout.

andrew harrison

unread,
May 14, 2016, 7:20:08 PM5/14/16
to tiddl...@googlegroups.com
That's awesome. Thank you jeremy. So here is what I ended up using:
.my-thing {
 display: none;
}

body.tc-dirty .my-thing {
 display: inline-block;
}

Reply all
Reply to author
Forward
0 new messages