diff options
| author | winter | 2025-03-16 02:13:38 +0000 |
|---|---|---|
| committer | winter | 2025-03-16 02:13:38 +0000 |
| commit | 26d2b0681084029260ed07e8a0a7c9e704d1c52a (patch) | |
| tree | 8bfc24663b4016808c8a55faf70a0ebd11658b72 /templates | |
| parent | dd4d47bde45d20954129ba256696bf12c3826cdd (diff) | |
reload timeline betterly for new notes
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/note/reply_form.php | 10 | ||||
| -rw-r--r-- | templates/note/write_form.php | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/templates/note/reply_form.php b/templates/note/reply_form.php index cd67ce8..e51466d 100644 --- a/templates/note/reply_form.php +++ b/templates/note/reply_form.php @@ -21,10 +21,12 @@ $scopeOptions = match ($note->privacy->scope) { }; $selectedScope = $note->privacy->scope->value; ?> -<form class="noteReplyForm" id="replyForm-<?= $note->id ?>" - _="on submit send toggle to previous <button.reply/> then wait 1s then trigger update on #liveTimelineUpdater on toggle or submit toggle @hidden" - hidden hx-post="/fragment/note/<?= $note->id ?>/reply" hx-disabled-elt="find button" hx-swap="outerHTML" - hx-target="this"> +<form class="noteReplyForm" id="replyForm-<?= $note->id ?>" _=" + on htmx:afterOnLoad + send toggle to #interactButton-reply-<?= $note->id ?> + then trigger update on #liveTimelineUpdater + on toggle or htmx:afterOnLoad toggle @hidden" hidden hx-post="/fragment/note/<?= $note->id ?>/reply" + hx-disabled-elt="find button" hx-swap="outerHTML" hx-target="this"> <div class="row summaryAndContent"> <label for="replyContent-<?= $note->id ?>"><?= __('writeReply.label') ?></label> <input type="text" id="replySummary-<?= $note->id ?>" name="summary" autocomplete="off" diff --git a/templates/note/write_form.php b/templates/note/write_form.php index f7b0b06..46422b0 100644 --- a/templates/note/write_form.php +++ b/templates/note/write_form.php @@ -4,7 +4,7 @@ </form> <form id="writeNoteForm" action="/todo" method="post" hx-post="/fragment/note" hx-swap="outerHTML" hx-target="this" - hx-disabled-elt="find button" _="on submit wait 1s then trigger update on #liveTimelineUpdater" + hx-disabled-elt="find button" _="on htmx:afterOnLoad trigger update on #liveTimelineUpdater" <?= ($_SERVER['REQUEST_METHOD'] == 'GET') ? 'hx-preserve' : '' ?>> <div class="row miniProfile"> <a href="/@/<?= $actor->handle ?>" hx-target="#centrePane" hx-swap="outerHTML show:window:top"> |
