Focus on edit after a tm-edit-tiddler message

瀏覽次數:50 次
跳到第一則未讀訊息

Cade Roux

未讀,
2019年9月3日 下午6:17:492019/9/3
收件者:TiddlyWiki
I have a set of macros that let me transclude a tiddler and offer a link next to the transcluded tiddler to edit it if it exists or a link button to create it if it's missing.

This is one of the relevant sub-macros for the Edit button:

\define edit-btn(title)
(<$button class="tc-btn-invisible tc-tiddlylink">
<$action-sendmessage $message="tm-edit-tiddler" $param="$title$"/>
Edit
</$button>)
\end

After the tm-edit-tiddler message, I want to set the focus on that draft tiddler that comes up so that the cursor is in the text field and not in the title field.

Any tips?

Thanks,

Cade

Cade Roux

未讀,
2019年9月10日 上午9:33:332019/9/10
收件者:TiddlyWiki
Bumping this up - is there any way to set the focus to the text instead of the title when you go into edit mode?

Thanks in advance,

Cade

Jeremy Ruston

未讀,
2019年9月10日 上午9:38:262019/9/10
收件者:tiddl...@googlegroups.com
Hi Cade

Bumping this up - is there any way to set the focus to the text instead of the title when you go into edit mode?

The mechanism by which the title gets the focus when a tiddler is edited is that the wikitext of the edittext widget includes the focus="true” attribute. So, as things stand, the only way to change that behaviour would be to overwrite that template to remove the focus attribute, and modify the body text tiddler to add a focus attribute.

You may be able to hack things with the new tm-focus-selector message...

Best wishes

Jeremy.


Thanks in advance,

Cade

On Tuesday, September 3, 2019 at 5:17:49 PM UTC-5, Cade Roux wrote:
I have a set of macros that let me transclude a tiddler and offer a link next to the transcluded tiddler to edit it if it exists or a link button to create it if it's missing.

This is one of the relevant sub-macros for the Edit button:

\define edit-btn(title)
(<$button class="tc-btn-invisible tc-tiddlylink">
<$action-sendmessage $message="tm-edit-tiddler" $param="$title$"/>
Edit
</$button>)
\end

After the tm-edit-tiddler message, I want to set the focus on that draft tiddler that comes up so that the cursor is in the text field and not in the title field.

Any tips?

Thanks,

Cade

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a714e54e-01ec-4376-b3f2-10c0232e7333%40googlegroups.com.

回覆所有人
回覆作者
轉寄
0 則新訊息