Skip to content

Commit 32403e4

Browse files
Fixed issue krayin#1985
1 parent baf5a3e commit 32403e4

File tree

2 files changed

+41
-31
lines changed

2 files changed

+41
-31
lines changed

packages/Webkul/Admin/src/Resources/assets/css/app.css

+4
Original file line numberDiff line numberDiff line change
@@ -641,4 +641,8 @@
641641

642642
.tox .tox-toolbar__group:last-child button:hover {
643643
@apply border-0 !bg-[#3389ec] text-white shadow-none;
644+
}
645+
646+
.tox.tox-silver-sink.tox-tinymce-aux {
647+
z-index: 99999;
644648
}

packages/Webkul/Admin/src/Resources/views/mail/index.blade.php

+37-31
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ class="!font-normal"
258258
<x-admin::modal
259259
ref="toggleComposeModal"
260260
position="bottom-right"
261+
@toggle="removeTinyMCE"
261262
>
262263
<x-slot:header>
263264
<h3 class="text-lg font-bold text-gray-800 dark:text-white">
@@ -379,6 +380,7 @@ class="w-[calc(100%-62px)]"
379380
rules="required"
380381
rows="8"
381382
::value="draft.reply"
383+
:tinymce="true"
382384
:label="trans('admin::app.mail.index.mail.message')"
383385
/>
384386
@@ -434,19 +436,19 @@ class="primary-button"
434436
<script type="module">
435437
app.component('v-mail', {
436438
template: '#v-mail-template',
437-
439+
438440
data() {
439441
return {
440442
selectedMail: false,
441-
443+
442444
showCC: false,
443-
445+
444446
showBCC: false,
445-
447+
446448
isStoring: false,
447-
449+
448450
saveAsDraft: 0,
449-
451+
450452
draft: {
451453
id: null,
452454
reply_to: [],
@@ -456,7 +458,7 @@ class="primary-button"
456458
reply: '',
457459
attachments: [],
458460
},
459-
461+
460462
backgroundColors: [
461463
{
462464
label: "@lang('admin::app.components.tags.index.aquarelle-red')",
@@ -486,53 +488,57 @@ class="primary-button"
486488
],
487489
};
488490
},
489-
491+
490492
mounted() {
491493
const params = new URLSearchParams(window.location.search);
492-
494+
493495
if (params.get('openModal')) {
494496
this.$refs.toggleComposeModal.toggle();
495497
}
496498
},
497-
499+
498500
methods: {
501+
removeTinyMCE() {
502+
tinymce?.remove?.();
503+
},
504+
499505
truncatedReply(reply) {
500506
const maxLength = 100;
501-
507+
502508
if (reply.length > maxLength) {
503509
return `${reply.substring(0, maxLength)}...`;
504510
}
505-
511+
506512
return reply;
507513
},
508-
514+
509515
toggleModal() {
510516
this.draft.reply_to = [];
511-
517+
512518
this.$refs.toggleComposeModal.toggle();
513519
},
514-
520+
515521
save(params, { resetForm, setErrors }) {
516522
this.isStoring = true;
517-
523+
518524
let formData = new FormData(this.$refs.mailForm);
519-
525+
520526
formData.append('is_draft', this.saveAsDraft);
521-
527+
522528
if (this.draft.id) {
523529
formData.append('_method', 'PUT');
524530
}
525-
531+
526532
this.$axios.post(this.draft.id ? "{{ route('admin.mail.update', ':id') }}".replace(':id', this.draft.id) : '{{ route('admin.mail.store') }}', formData, {
527533
headers: {
528534
'Content-Type': 'multipart/form-data',
529535
},
530536
})
531537
.then ((response) => {
532538
this.$refs.datagrid.get();
533-
539+
534540
this.$emitter.emit('add-flash', { type: 'success', message: response.data?.message });
535-
541+
536542
resetForm();
537543
})
538544
.catch ((error) => {
@@ -543,34 +549,34 @@ class="primary-button"
543549
}
544550
}).finally(() => {
545551
this.$refs.toggleComposeModal.close();
546-
552+
547553
this.isStoring = false;
548-
554+
549555
this.resetForm();
550556
});
551557
},
552-
558+
553559
editModal(row) {
554560
if(row.title == 'View') {
555561
window.location.href = row.url;
556-
562+
557563
return;
558564
}
559-
565+
560566
this.$axios.get(row.url)
561567
.then(response => {
562568
this.draft = response.data.data;
563-
569+
564570
this.$refs.toggleComposeModal.toggle();
565-
571+
566572
this.showCC = this.draft.cc.length > 0;
567-
573+
568574
this.showBCC = this.draft.bcc.length > 0;
569-
575+
570576
})
571577
.catch(error => {});
572578
},
573-
579+
574580
resetForm() {
575581
this.draft = {
576582
id: null,

0 commit comments

Comments
 (0)