Monorepo for Tangled

appview/replyComment: add submit shortcut

Signed-off-by: marco.tngl.sh <dev@marco.social>

authored by

marco.tngl.sh and committed by tangled.org 43c02a0b 3aa55530

+2 -5
+2 -5
appview/pages/templates/repo/issues/fragments/replyComment.html
··· 3 class="p-2 group w-full border-t border-gray-200 dark:border-gray-700 flex flex-col gap-2" 4 id="reply-form-{{ .Comment.Id }}" 5 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 6 hx-on::after-request="if(event.detail.successful) this.reset()" 7 hx-disabled-elt="#reply-{{ .Comment.Id }}" 8 > ··· 13 class="w-full p-2" 14 placeholder="Leave a reply..." 15 autofocus 16 - rows="3" 17 - hx-trigger="keydown[ctrlKey&&key=='Enter']" 18 - hx-target="#reply-form-{{ .Comment.Id }}" 19 - hx-get="#" 20 - hx-on:htmx:before-request="event.preventDefault(); document.getElementById('reply-form-{{ .Comment.Id }}').requestSubmit()"></textarea> 21 22 <input 23 type="text"
··· 3 class="p-2 group w-full border-t border-gray-200 dark:border-gray-700 flex flex-col gap-2" 4 id="reply-form-{{ .Comment.Id }}" 5 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 6 + hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:#reply-{{.Comment.Id}}-textarea" 7 hx-on::after-request="if(event.detail.successful) this.reset()" 8 hx-disabled-elt="#reply-{{ .Comment.Id }}" 9 > ··· 14 class="w-full p-2" 15 placeholder="Leave a reply..." 16 autofocus 17 + rows="3"></textarea> 18 19 <input 20 type="text"