now with git support
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
<div {{ $attributes->whereDoesntStartWith('wire:model')->merge(['class' => 'space-y-2']) }}
|
||||
@if ($model) data-helpdesk-editor-model="{{ $model }}" @endif
|
||||
x-on:helpdesk-editor-reset.window="if ($event.detail.model === model) clear()"
|
||||
x-on:helpdesk-editor-reset.window="if ($event.detail.model === model) clear($event.detail.value || '')"
|
||||
x-on:helpdesk-editor-sync.window="if ($event.detail.model === model) syncToLivewire()"
|
||||
x-data="{
|
||||
model: @js($model),
|
||||
@@ -54,12 +54,12 @@
|
||||
|
||||
this.$nextTick(() => this.syncToHiddenInput());
|
||||
},
|
||||
clear() {
|
||||
this.value = '';
|
||||
this.$refs.editor.innerHTML = '';
|
||||
clear(value = '') {
|
||||
this.value = value || '';
|
||||
this.$refs.editor.innerHTML = this.value;
|
||||
|
||||
if (this.model) {
|
||||
this.$wire.set(this.model, '', false);
|
||||
this.$wire.set(this.model, this.value, false);
|
||||
}
|
||||
},
|
||||
init() {
|
||||
@@ -103,7 +103,7 @@
|
||||
class="rounded-lg px-2 py-1 text-sm hover:bg-zinc-200 dark:hover:bg-zinc-800">Clear</button>
|
||||
</div>
|
||||
|
||||
<div x-ref="editor" contenteditable="true" spellcheck="true" lang="en-GB" autocapitalize="sentences" autocorrect="on" autocomplete="off" inputmode="text"
|
||||
<div x-ref="editor" contenteditable="true" spellcheck="true" lang="en-GB" autocapitalize="sentences" autocorrect="on" inputmode="text" aria-multiline="true" role="textbox"
|
||||
@if ($editorDusk) data-dusk="{{ $editorDusk }}" dusk="{{ $editorDusk }}" @endif
|
||||
x-on:paste="handlePaste($event)" x-on:blur="syncToHiddenInput()"
|
||||
class="helpdesk-rich-editor prose prose-sm min-h-[{{ (int) $rows * 28 }}px] max-w-none bg-white p-4 text-sm text-zinc-900 outline-none dark:prose-invert dark:bg-zinc-950 dark:text-zinc-100"
|
||||
|
||||
Reference in New Issue
Block a user