@@ -366,6 +366,8 @@ export default {
366
366
this .$emit (' updated:contributors' , newContributors);
367
367
}
368
368
this .closeFormModal ();
369
+
370
+ this .getAndUpdatePublication ();
369
371
},
370
372
371
373
/**
@@ -374,20 +376,7 @@ export default {
374
376
openPreviewModal () {
375
377
this .isLoading = true ;
376
378
377
- $ .ajax ({
378
- url: this .publicationApiUrl ,
379
- type: ' GET' ,
380
- context: this ,
381
- error: this .ajaxErrorCallback ,
382
- success (publication ) {
383
- this .$emit (' updated:publication' , publication);
384
-
385
- this .isModalOpenedPreview = true ;
386
- },
387
- complete (r ) {
388
- this .isLoading = false ;
389
- },
390
- });
379
+ this .getAndUpdatePublication ();
391
380
},
392
381
393
382
/**
@@ -445,6 +434,8 @@ export default {
445
434
},
446
435
);
447
436
this .$emit (' updated:contributors' , newContributors);
437
+
438
+ this .getAndUpdatePublication ();
448
439
},
449
440
complete (r ) {
450
441
this .isLoading = false ;
@@ -529,6 +520,8 @@ export default {
529
520
cancelOrdering () {
530
521
this .$emit (' updated:contributors' , this .itemsBeforeReordering );
531
522
523
+ this .getAndUpdatePublication ();
524
+
532
525
this .itemsBeforeReordering = null ;
533
526
this .isOrdering = false ;
534
527
},
@@ -563,20 +556,7 @@ export default {
563
556
success (contributors ) {
564
557
this .$emit (' updated:contributors' , contributors);
565
558
566
- // Update the publication in the background so that
567
- // any author strings are updated
568
- $ .ajax ({
569
- url: this .publicationApiUrl ,
570
- context: this ,
571
- type: ' GET' ,
572
- success (publication ) {
573
- this .$emit (' updated:publication' , publication);
574
- },
575
- complete () {
576
- this .isLoading = false ;
577
- this .isOrdering = false ;
578
- },
579
- });
559
+ this .getAndUpdatePublication ();
580
560
},
581
561
error: this .ajaxErrorCallback ,
582
562
complete () {
@@ -651,6 +631,26 @@ export default {
651
631
652
632
this .$emit (' updated:contributors' , newItems);
653
633
},
634
+
635
+ /**
636
+ * Update the publication in the background so that
637
+ * any author strings are updated
638
+ */
639
+ getAndUpdatePublication () {
640
+ $ .ajax ({
641
+ url: this .publicationApiUrl ,
642
+ context: this ,
643
+ type: ' GET' ,
644
+ success (publication ) {
645
+ this .$emit (' updated:publication' , publication);
646
+ },
647
+ complete () {
648
+ this .isLoading = false ;
649
+ this .isOrdering = false ;
650
+ },
651
+ });
652
+ },
653
+
654
654
},
655
655
};
656
656
</script >
0 commit comments