Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/newComment: add submit shortcut

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

authored by

marco.tngl.sh and committed by tangled.org 0b197624 3ca87ebe

+8 -2
+8 -2
appview/pages/templates/repo/issues/fragments/newComment.html
··· 3 3 <form 4 4 id="comment-form" 5 5 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 6 + hx-trigger="submit, keydown[commentButtonEnabled() && (ctrlKey || metaKey) && key=='Enter'] from:#comment-textarea" 7 + hx-indicator="#comment-button" 8 + hx-disabled-elt="#comment-form button" 6 9 hx-on::after-request="if(event.detail.successful) this.reset()" 7 10 > 8 11 <div class="bg-white dark:bg-gray-800 rounded drop-shadow-sm py-4 px-4 relative w-full"> ··· 27 24 <div class="flex gap-2 mt-2"> 28 25 <button 29 26 id="comment-button" 30 - hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 31 27 type="submit" 32 - hx-disabled-elt="#comment-button" 33 28 class="btn-create p-2 flex items-center gap-2 no-underline hover:no-underline group" 34 29 disabled 35 30 > ··· 102 101 {{ end }} 103 102 104 103 <script> 104 + function commentButtonEnabled() { 105 + const commentButton = document.getElementById('comment-button'); 106 + return !commentButton.hasAttribute('disabled'); 107 + } 108 + 105 109 function updateCommentForm() { 106 110 const textarea = document.getElementById('comment-textarea'); 107 111 const commentButton = document.getElementById('comment-button');