فهرست منبع

module TimeGridEventDragUtils

Adam Shaw 8 سال پیش
والد
کامیت
422d1582e8
2فایلهای تغییر یافته به همراه18 افزوده شده و 21 حذف شده
  1. 17 21
      tests/event-drag/TimeGridEventDragUtils.js
  2. 1 0
      tests/event-drag/repeating.js

+ 17 - 21
tests/event-drag/TimeGridEventDragUtils.js

@@ -1,25 +1,21 @@
 
-var TimeGridEventDragUtils = {
+export function drag(startDate, endDate, debug) {
 
-	drag: function(startDate, endDate, debug) {
+	startDate = $.fullCalendar.moment.parseZone(startDate);
+	endDate = $.fullCalendar.moment.parseZone(endDate);
 
-		startDate = $.fullCalendar.moment.parseZone(startDate);
-		endDate = $.fullCalendar.moment.parseZone(endDate);
+	var startRect = TimeGridEventRenderUtils.computeSpanRects(
+		startDate,
+		startDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
+	)[0];
+	var endRect = TimeGridEventRenderUtils.computeSpanRects(
+		endDate,
+		endDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
+	)[0];
 
-		var startRect = TimeGridEventRenderUtils.computeSpanRects(
-			startDate,
-			startDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
-		)[0];
-		var endRect = TimeGridEventRenderUtils.computeSpanRects(
-			endDate,
-			endDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
-		)[0];
-
-		return EventDragUtils.drag(
-			startRect,
-			endRect,
-			debug
-		);
-	}
-
-};
+	return EventDragUtils.drag(
+		startRect,
+		endRect,
+		debug
+	);
+}

+ 1 - 0
tests/event-drag/repeating.js

@@ -1,3 +1,4 @@
+import * as TimeGridEventDragUtils from './TimeGridEventDragUtils';
 
 describe('event dragging on repeating events', function() {
 	pushOptions({