[tw5] Adjusting the EditTemplate body editor height dynamically

48 views
Skip to first unread message

AdamS

unread,
Dec 11, 2018, 8:23:03 PM12/11/18
to TiddlyWiki
So the title pretty much says it. Specifically, I'm trying to make the text box take up however much space is left in the tiddler and scroll once that space is used up. Near as I can tell, though, both options for the editor height are built into the edit widget. Does anyone know of a workaround for this? Or is making a new widget the only way forward on this problem?

Best regards,

AdamS

AdamS

unread,
Dec 12, 2018, 12:30:39 PM12/12/18
to TiddlyWiki
I've noticed that in an empty tiddlywiki, the edit textarea of a tiddler is within an iframe element. Dealing with sizing on the iframe is not easy as I can't directly get access to the content embedded in it (in CSS). But I've noticed that in the CodeMirror demo site (https://tiddlywiki.com/plugins/tiddlywiki/codemirror/), the surrounding element is a div (and not one of the codeMirror divs). This is strange to me because in both cases, $:/core/ui/EditTemplate/body/editor and $:/core/ui/EditTemplate/body are the same.

I've also noticed that there are two separate modules for handling the edit textarea of a tiddler: $:/core/modules/editor/engines/framed.js   which I assume produces a textarea inside an iframe. And  $:/core/modules/editor/engines/simple.js  which puts the textarea inside a div. Both of these modules are present. What I cannot seem to figure out is what determines which one will run in the case of a tiddler in edit mode. Is there some way I can toggle between them? Being able to simply work with the div would make what I'm trying to do a lot easier. If anyone can point me in the right direction on this, I'd be very much obliged.

Best regards,

Adam
Reply all
Reply to author
Forward
0 new messages