Browse Source

buildMutatedEventInstanceGroup

Adam Shaw 8 years ago
parent
commit
7170d91124
2 changed files with 8 additions and 12 deletions
  1. 6 10
      src/common/Grid.events.js
  2. 2 2
      src/models/EventManager.js

+ 6 - 10
src/common/Grid.events.js

@@ -373,11 +373,9 @@ Grid.mixin({
 					eventDefMutation = _this.computeEventDropMutation(origFootprint, footprint);
 					eventDefMutation = _this.computeEventDropMutation(origFootprint, footprint);
 
 
 					if (eventDefMutation) {
 					if (eventDefMutation) {
-						mutatedEventInstanceGroup = new EventInstanceGroup(
-							eventManager.buildMutatedEventInstances( // TODO: buildMutatedEventInstanceGroup?
-								eventManager.getEventDefByUid(event._id).id,
-								eventDefMutation
-							)
+						mutatedEventInstanceGroup = eventManager.buildMutatedEventInstanceGroup(
+							eventManager.getEventDefByUid(event._id).id,
+							eventDefMutation
 						);
 						);
 						isAllowed = _this.isEventInstanceGroupAllowed(mutatedEventInstanceGroup);
 						isAllowed = _this.isEventInstanceGroupAllowed(mutatedEventInstanceGroup);
 					}
 					}
@@ -760,11 +758,9 @@ Grid.mixin({
 						_this.computeEventEndResizeMutation(origHitFootprint, hitFootprint, event);
 						_this.computeEventEndResizeMutation(origHitFootprint, hitFootprint, event);
 
 
 					if (resizeMutation) {
 					if (resizeMutation) {
-						mutatedEventInstanceGroup = new EventInstanceGroup(
-							eventManager.buildMutatedEventInstances(
-								eventManager.getEventDefByUid(event._id).id,
-								resizeMutation
-							)
+						mutatedEventInstanceGroup = eventManager.buildMutatedEventInstanceGroup(
+							eventManager.getEventDefByUid(event._id).id,
+							resizeMutation
 						);
 						);
 						isAllowed = _this.isEventInstanceGroupAllowed(mutatedEventInstanceGroup);
 						isAllowed = _this.isEventInstanceGroupAllowed(mutatedEventInstanceGroup);
 					}
 					}

+ 2 - 2
src/models/EventManager.js

@@ -272,7 +272,7 @@ var EventManager = Class.extend(EmitterMixin, ListenerMixin, {
 	/*
 	/*
 	copies and then mutates
 	copies and then mutates
 	*/
 	*/
-	buildMutatedEventInstances: function(eventDefId, eventDefMutation) {
+	buildMutatedEventInstanceGroup: function(eventDefId, eventDefMutation) {
 		var eventDefs = this.getEventDefsById(eventDefId);
 		var eventDefs = this.getEventDefsById(eventDefId);
 		var i;
 		var i;
 		var defCopy;
 		var defCopy;
@@ -290,7 +290,7 @@ var EventManager = Class.extend(EmitterMixin, ListenerMixin, {
 			}
 			}
 		}
 		}
 
 
-		return allInstances;
+		return new EventInstanceGroup(allInstances);
 	},
 	},