@@ -258,6 +258,7 @@ class="!font-normal"
258
258
< x- admin:: modal
259
259
ref= " toggleComposeModal"
260
260
position= " bottom-right"
261
+ @toggle = " removeTinyMCE"
261
262
>
262
263
< x- slot: header>
263
264
< h3 class = " text-lg font-bold text-gray-800 dark:text-white" >
@@ -379,6 +380,7 @@ class="w-[calc(100%-62px)]"
379
380
rules= " required"
380
381
rows= " 8"
381
382
:: value= " draft.reply"
383
+ : tinymce= " true"
382
384
: label= " trans('admin::app.mail.index.mail.message')"
383
385
/ >
384
386
@@ -434,19 +436,19 @@ class="primary-button"
434
436
<script type =" module" >
435
437
app .component (' v-mail' , {
436
438
template: ' #v-mail-template' ,
437
-
439
+
438
440
data () {
439
441
return {
440
442
selectedMail: false ,
441
-
443
+
442
444
showCC: false ,
443
-
445
+
444
446
showBCC: false ,
445
-
447
+
446
448
isStoring: false ,
447
-
449
+
448
450
saveAsDraft: 0 ,
449
-
451
+
450
452
draft: {
451
453
id: null ,
452
454
reply_to: [],
@@ -456,7 +458,7 @@ class="primary-button"
456
458
reply: ' ' ,
457
459
attachments: [],
458
460
},
459
-
461
+
460
462
backgroundColors: [
461
463
{
462
464
label: " @lang (' admin::app.components.tags.index.aquarelle-red' )" ,
@@ -486,53 +488,57 @@ class="primary-button"
486
488
],
487
489
};
488
490
},
489
-
491
+
490
492
mounted () {
491
493
const params = new URLSearchParams (window .location .search );
492
-
494
+
493
495
if (params .get (' openModal' )) {
494
496
this .$refs .toggleComposeModal .toggle ();
495
497
}
496
498
},
497
-
499
+
498
500
methods: {
501
+ removeTinyMCE () {
502
+ tinymce? .remove ? .();
503
+ },
504
+
499
505
truncatedReply (reply ) {
500
506
const maxLength = 100 ;
501
-
507
+
502
508
if (reply .length > maxLength) {
503
509
return ` ${ reply .substring (0 , maxLength)} ...` ;
504
510
}
505
-
511
+
506
512
return reply;
507
513
},
508
-
514
+
509
515
toggleModal () {
510
516
this .draft .reply_to = [];
511
-
517
+
512
518
this .$refs .toggleComposeModal .toggle ();
513
519
},
514
-
520
+
515
521
save (params , { resetForm, setErrors }) {
516
522
this .isStoring = true ;
517
-
523
+
518
524
let formData = new FormData (this .$refs .mailForm );
519
-
525
+
520
526
formData .append (' is_draft' , this .saveAsDraft );
521
-
527
+
522
528
if (this .draft .id ) {
523
529
formData .append (' _method' , ' PUT' );
524
530
}
525
-
531
+
526
532
this .$axios .post (this .draft .id ? " {{ route (' admin.mail.update' , ' :id' ) } }" .replace (' :id' , this .draft .id ) : ' {{ route (' admin.mail.store' ) } }' , formData, {
527
533
headers: {
528
534
' Content-Type' : ' multipart/form-data' ,
529
535
},
530
536
})
531
537
.then ((response ) => {
532
538
this .$refs .datagrid .get ();
533
-
539
+
534
540
this .$emitter .emit (' add-flash' , { type: ' success' , message: response .data ? .message });
535
-
541
+
536
542
resetForm ();
537
543
})
538
544
.catch ((error ) => {
@@ -543,34 +549,34 @@ class="primary-button"
543
549
}
544
550
}).finally (() => {
545
551
this .$refs .toggleComposeModal .close ();
546
-
552
+
547
553
this .isStoring = false ;
548
-
554
+
549
555
this .resetForm ();
550
556
});
551
557
},
552
-
558
+
553
559
editModal (row ) {
554
560
if (row .title == ' View' ) {
555
561
window .location .href = row .url ;
556
-
562
+
557
563
return ;
558
564
}
559
-
565
+
560
566
this .$axios .get (row .url )
561
567
.then (response => {
562
568
this .draft = response .data .data ;
563
-
569
+
564
570
this .$refs .toggleComposeModal .toggle ();
565
-
571
+
566
572
this .showCC = this .draft .cc .length > 0 ;
567
-
573
+
568
574
this .showBCC = this .draft .bcc .length > 0 ;
569
-
575
+
570
576
})
571
577
.catch (error => {});
572
578
},
573
-
579
+
574
580
resetForm () {
575
581
this .draft = {
576
582
id: null ,
0 commit comments