added support for legacy tickets, fixed switching of modes and also style updates

This commit is contained in:
Mark Gregory
2026-10-09 14:04:47 +01:00
parent 8db97cd60c
commit c71479d119
2 changed files with 20 additions and 39 deletions
+5 -25
View File
@@ -18,33 +18,9 @@
x-on:submit.capture="
if (helpdeskAttachmentsUploading) {
$event.preventDefault();
$event.stopImmediatePropagation();
return;
}
const editor = document.querySelector('[data-helpdesk-sync-target="body"], [data-helpdesk-editor-model="body"]');
const target = Array.from(document.querySelectorAll('textarea')).find(function (textarea) {
return textarea.getAttribute('wire:model.defer') === 'body'
|| textarea.getAttribute('wire:model') === 'body'
|| textarea.getAttribute('name') === 'body'
|| textarea.id === 'body';
});
const body = (editor?.innerText || editor?.textContent || editor?.value || '').trim();
if (target) {
target.value = body;
target.dispatchEvent(new Event('input', { bubbles: true }));
target.dispatchEvent(new Event('change', { bubbles: true }));
}
if ($wire) {
$wire.set('body', body, false);
}
$dispatch('helpdesk-editor-sync', { model: 'body', live: false });
"
class="helpdesk-ticket-form space-y-6"
@@ -245,6 +221,10 @@
editor-dusk="ticket-body-editor"
/>
@error('body')
<p class="mt-2 text-sm text-red-500" role="alert">{{ $message }}</p>
@enderror
<p class="mt-2 flex items-center gap-2 text-xs font-medium text-zinc-400">
<i class="fa-solid fa-circle-info text-blue-400" aria-hidden="true"></i>
Rich formatting is available. Browser spelling suggestions appear by right-clicking or Ctrl-clicking red-underlined words.