title: whateveryouwant
tags: $:/tags/Stylesheet
type: text/css
text:
.tc-editor-toolbar {
position:sticky;
position: -webkit-sticky;
position: sticky;
top: 0px; /* distance to stick from top, e.g if you use top bar */
left:0;
width:100%;
font-size:0;
line-height:0;
padding:0;
border:6px solid transparent;
margin-top:-11px; /* pull it up */
Xoutline:1px solid blue; /* remove the X to peek where it all resides */
}
.tc-editor-toolbar:hover {
font-size:1em;
border-color:white;
background:white;
}
.tc-editor-toolbar button {
display:none;
padding:0px;
}
.tc-editor-toolbar:hover button {
display:inline-block;
}Sorry if the question I have is not phrased with the proper terms.I'd like to have the 'tc-editor-toolbar' div have a sticky position. This works when it is under tc-reveal, but when I use preview, it gets transcluded under tc-tiddler-preview.What is the best way to have it stay under tc-reveal when preview mode is on? I understand transclusion happens in $:/core/ui/EditTemplate/body, should I override it? How? Maybe have some other code move it in place after the transclusion? Again, how?
(For future reference, how can I see the code of shadow tiddlers? Finding them on github is tedious and in TiddlyWiki I see them as empty. Maybe there's a plugin that allows exploration of other plugins that are installed? )
The problem with the sticky editor is well known. See e.g. [1]
As far as I know the problem stems from the fact that the editor is used in an iFrame. See e.g. [2]
Another problem is that (caused by the iFrame) bookmarklets don't work (they work with the editor toolbar switched off!)
I created a small toolbar (below the tags) for e.g. toggling the editor toolbar on/off, preview on/off, scrollable preview on/off.
See the tab Code tiddlers at 'My playground' at [3]
Well, in chrome, if I move the tc-editor-toolbar div outside of the tc-tiddler-preview div, then it works as expected. I think this is just a case of it being part of the editor tiddler and then the preview tiddler transcludes the editor tiddler as a whole rather than (if possible) separating the edit pane from whatever else is in that tiddler. The relevant code that creates tc-editor-toolbar is in EditTextWidget in $:/core/modules/editor/factory.js (which I couldn't locate in your explorer preset filters)
and the creation of the preview div is in $:/core/ui/EditTemplate/body (which I couldn't find in your explorer preset filters either), which transcludes $:/core/ui/EditTemplate/body/editorI don't know what I can/should override and what I cannot. But if I can't override, is there a way to run after the widget rendered (or any other suitable hook) to fix the dom?
I created a small toolbar (below the tags) for e.g. toggling the editor toolbar on/off, preview on/off, scrollable preview on/off.
See the tab Code tiddlers at 'My playground' at [3]Installed it, 'scrollable preview' doesn't seem to change anything? Am I missing something?