Explorar el Código

triggers for event switching calendars

Adam Shaw hace 7 años
padre
commit
b09c7fd6a7
Se han modificado 1 ficheros con 16 adiciones y 1 borrados
  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
         // dropped in different calendar
-        // TODO: more public triggers
         } else if (receivingCalendar) {
         } else if (receivingCalendar) {
 
 
+          initialCalendar.publiclyTrigger('eventLeave', [
+            {
+              draggedEl: ev.subjectEl,
+              event: eventApi,
+              view: initialView
+            }
+          ])
+
           initialCalendar.dispatch({
           initialCalendar.dispatch({
             type: 'REMOVE_EVENT_INSTANCES',
             type: 'REMOVE_EVENT_INSTANCES',
             instances: this.mutatedRelevantEvents!.instances
             instances: this.mutatedRelevantEvents!.instances
@@ -264,6 +271,14 @@ export default class EventDragging { // TODO: rename to EventSelectingAndDraggin
               eventInstanceId: eventInstance.instanceId
               eventInstanceId: eventInstance.instanceId
             })
             })
           }
           }
+
+          receivingCalendar.publiclyTrigger('eventReceive', [
+            {
+              draggedEl: ev.subjectEl,
+              event: new EventApi(receivingCalendar, eventDef, eventInstance),
+              view: this.hitDragging.finalHit.component
+            }
+          ])
         }
         }
 
 
       } else {
       } else {