Adam Shaw 8 سال پیش
والد
کامیت
5abe933510
3فایلهای تغییر یافته به همراه25 افزوده شده و 15 حذف شده
  1. 12 2
      src/common/Grid.events.js
  2. 11 11
      src/common/Grid.js
  3. 2 2
      tests/event-drag/EventDragUtils.js

+ 12 - 2
src/common/Grid.events.js

@@ -1041,7 +1041,12 @@ Grid.mixin({
 		var i;
 
 		for (i = 0; i < eventFootprints.length; i++) {
-			if (!this.isFootprintInRange(eventFootprints[i].componentFootprint)) {
+			if (
+				!isRangeWithinRange(
+					eventFootprints[i].componentFootprint.dateRange.getRange(),
+					this.view.validRange
+				)
+			) {
 				return false;
 			}
 		}
@@ -1057,7 +1062,12 @@ Grid.mixin({
 		var i;
 
 		for (i = 0; i < eventFootprints.length; i++) {
-			if (!this.isFootprintInRange(eventFootprints[i].componentFootprint)) {
+			if (
+				!isRangeWithinRange(
+					eventFootprints[i].componentFootprint.dateRange.getRange(),
+					this.view.validRange
+				)
+			) {
 				return false;
 			}
 		}

+ 11 - 11
src/common/Grid.js

@@ -127,14 +127,6 @@ var Grid = FC.Grid = ChronoComponent.extend({
 	},
 
 
-	isFootprintInRange: function(componentFootprint) { // used by other things too
-		return isRangeWithinRange(
-			componentFootprint.dateRange.getRange(),
-			this.view.validRange
-		);
-	},
-
-
 	// Diffs the two dates, returning a duration, based on granularity of the grid
 	// TODO: port isTimeScale into this system?
 	diffDates: function(a, b) {
@@ -186,7 +178,12 @@ var Grid = FC.Grid = ChronoComponent.extend({
 	getSafeHitFootprint: function(hit) {
 		var footprint = this.getHitFootprint(hit);
 
-		if (!this.isFootprintInRange(footprint)) {
+		if (
+			!isRangeWithinRange(
+				footprint.dateRange.getRange(),
+				this.view.activeRange
+			)
+		) {
 			return null;
 		}
 
@@ -544,8 +541,11 @@ var Grid = FC.Grid = ChronoComponent.extend({
 
 
 	isSelectionFootprintAllowed: function(componentFootprint) {
-		return this.isFootprintInRange(componentFootprint) &&
-			this.view.calendar.isSelectionFootprintAllowed(componentFootprint);
+		return isRangeWithinRange(
+			componentFootprint.dateRange.getRange(),
+			this.view.validRange
+		) &&
+		this.view.calendar.isSelectionFootprintAllowed(componentFootprint);
 	},
 
 

+ 2 - 2
tests/event-drag/EventDragUtils.js

@@ -26,13 +26,13 @@ var EventDragUtils = {
 		currentCalendar.on('eventDragStop', function() {
 			setTimeout(function() {
 				deferred.resolve({ isSuccess: false }); // won't do anything if already eventDrop
-			}, 20);  // will happen after eventDrop's timeout
+			}, 200);  // will happen after eventDrop's timeout
 		});
 
 		currentCalendar.on('eventDrop', function(event) { // always called after eventDragStop, if success
 			setTimeout(function() {
 				deferred.resolve({ isSuccess: true, event: event });
-			}, 10); // will happen first
+			}, 100); // will happen first
 		});
 
 		return deferred.promise();