Prechádzať zdrojové kódy

relocate to new file. reduce number of functions

Adam Shaw 8 rokov pred
rodič
commit
6a49ce50f4
4 zmenil súbory, kde vykonal 14 pridanie a 20 odobranie
  1. 1 0
      src.json
  2. 11 0
      src/Calendar.constraints.js
  3. 0 19
      src/EventManager.js
  4. 2 1
      src/common/Grid.events.js

+ 1 - 0
src.json

@@ -41,6 +41,7 @@
     "Calendar.render.js",
     "Calendar.toolbar.js",
     "Calendar.business.js",
+    "Calendar.constraints.js",
     "defaults.js",
     "locale.js",
     "Header.js",

+ 11 - 0
src/Calendar.constraints.js

@@ -0,0 +1,11 @@
+
+Calendar.prototype.isEventFootprintAllowed = function(eventFootprint) {
+	console.log('isEventFootprintAllowed', eventFootprint);
+	return true;
+};
+
+
+Calendar.prototype.isSelectionFootprintAllowed = function(componentFootprint) {
+	console.log('isSelectionFootprintAllowed', componentFootprint);
+	return true;
+};

+ 0 - 19
src/EventManager.js

@@ -1259,25 +1259,6 @@ Calendar.prototype.buildMutatedEventInstanceGroup = function(eventId, eventMutat
 -----------------------------------------------------------------------------------------*/
 
 
-Calendar.prototype.isEventFootprintAllowed = function(eventFootprint) {
-	console.log('isEventFootprintAllowed', eventFootprint);
-	return true;
-};
-
-
-// when it's a completely anonymous external drag, no event.
-Calendar.prototype.isExternalFootprintAllowed = function(componentFootprint) {
-	console.log('isExternalFootprintAllowed', componentFootprint);
-	return true;
-};
-
-
-Calendar.prototype.isSelectionFootprintAllowed = function(componentFootprint) {
-	console.log('isSelectionFootprintAllowed', componentFootprint);
-	return true;
-};
-
-
 // Determines if the given event can be relocated to the given span (unzoned start/end with other misc data)
 Calendar.prototype.isEventSpanAllowed = function(span, event) {
 	var source = event.source || {};

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

@@ -1043,7 +1043,8 @@ Grid.mixin({
 		}
 
 		for (i = 0; i < eventFootprints.length; i++) {
-			if (!calendar.isExternalFootprintAllowed(eventFootprints[i])) {
+			// treat it as a selection
+			if (!calendar.isSelectionFootprintAllowed(eventFootprints[i].componentFootprint)) {
 				return false;
 			}
 		}