Kaynağa Gözat

triggers for event switching calendars

Adam Shaw 7 yıl önce
ebeveyn
işleme
b09c7fd6a7
1 değiştirilmiş dosya ile 16 ekleme ve 1 silme
  1. 16 1
      src/interactions/EventDragging.ts

+ 16 - 1
src/interactions/EventDragging.ts

@@ -245,9 +245,16 @@ export default class EventDragging { // TODO: rename to EventSelectingAndDraggin
           ])
 
         // dropped in different calendar
-        // TODO: more public triggers
         } else if (receivingCalendar) {
 
+          initialCalendar.publiclyTrigger('eventLeave', [
+            {
+              draggedEl: ev.subjectEl,
+              event: eventApi,
+              view: initialView
+            }
+          ])
+
           initialCalendar.dispatch({
             type: 'REMOVE_EVENT_INSTANCES',
             instances: this.mutatedRelevantEvents!.instances
@@ -264,6 +271,14 @@ export default class EventDragging { // TODO: rename to EventSelectingAndDraggin
               eventInstanceId: eventInstance.instanceId
             })
           }
+
+          receivingCalendar.publiclyTrigger('eventReceive', [
+            {
+              draggedEl: ev.subjectEl,
+              event: new EventApi(receivingCalendar, eventDef, eventInstance),
+              view: this.hitDragging.finalHit.component
+            }
+          ])
         }
 
       } else {