Browse Source

change init of externaldropping

Adam Shaw 8 năm trước cách đây
mục cha
commit
027f7b7065

+ 0 - 3
src/common/DayGrid.js

@@ -24,9 +24,6 @@ var DayGrid = FC.DayGrid = ChronoComponent.extend(CoordChronoComponentMixin, Seg
 
 
 		ChronoComponent.apply(this, arguments);
 		ChronoComponent.apply(this, arguments);
 
 
-		// a requirement for CoordChronoComponentMixin
-		this.initCoordChronoComponent();
-
 		// a requirement for SegChronoComponentMixin. TODO: more elegant
 		// a requirement for SegChronoComponentMixin. TODO: more elegant
 		this.initSegChronoComponent();
 		this.initSegChronoComponent();
 	},
 	},

+ 0 - 3
src/common/TimeGrid.js

@@ -46,9 +46,6 @@ var TimeGrid = FC.TimeGrid = ChronoComponent.extend(CoordChronoComponentMixin, S
 
 
 		ChronoComponent.apply(this, arguments); // call the super-constructor
 		ChronoComponent.apply(this, arguments); // call the super-constructor
 
 
-		// a requirement for CoordChronoComponentMixin
-		this.initCoordChronoComponent();
-
 		// a requirement for SegChronoComponentMixin
 		// a requirement for SegChronoComponentMixin
 		this.initSegChronoComponent();
 		this.initSegChronoComponent();
 
 

+ 4 - 21
src/component/CoordChronoComponentMixin.js

@@ -24,11 +24,6 @@ var CoordChronoComponentMixin = {
 	hitsNeededDepth: 0, // necessary because multiple callers might need the same hits
 	hitsNeededDepth: 0, // necessary because multiple callers might need the same hits
 
 
 
 
-	initCoordChronoComponent: function() {
-		this.externalDropping = new this.externalDroppingClass(this);
-	},
-
-
 	// Diffs the two dates, returning a duration, based on granularity of the grid
 	// Diffs the two dates, returning a duration, based on granularity of the grid
 	// TODO: port isTimeScale into this system?
 	// TODO: port isTimeScale into this system?
 	diffDates: function(a, b) {
 	diffDates: function(a, b) {
@@ -62,6 +57,9 @@ var CoordChronoComponentMixin = {
 	setElement: function(el) {
 	setElement: function(el) {
 		ChronoComponent.prototype.setElement.apply(this, arguments);
 		ChronoComponent.prototype.setElement.apply(this, arguments);
 
 
+		(this.externalDropping = new this.externalDroppingClass(this))
+			.bindToDocument();
+
 		(this.dateClicking = new DateClicking(this)).bindToEl(this.el);
 		(this.dateClicking = new DateClicking(this)).bindToEl(this.el);
 		(this.dateSelecting = new DateSelecting(this)).bindToEl(this.el);
 		(this.dateSelecting = new DateSelecting(this)).bindToEl(this.el);
 
 
@@ -79,6 +77,7 @@ var CoordChronoComponentMixin = {
 		ChronoComponent.prototype.removeElement.apply(this, arguments);
 		ChronoComponent.prototype.removeElement.apply(this, arguments);
 
 
 		this.endInteractions();
 		this.endInteractions();
+		this.externalDropping.unbindFromDocument();
 	},
 	},
 
 
 
 
@@ -93,22 +92,6 @@ var CoordChronoComponentMixin = {
 	------------------------------------------------------------------------------------------------------------------*/
 	------------------------------------------------------------------------------------------------------------------*/
 
 
 
 
-	// Binds DOM handlers to elements that reside outside the grid, such as the document
-	bindGlobalHandlers: function() {
-		ChronoComponent.prototype.bindGlobalHandlers.apply(this, arguments);
-
-		this.externalDropping.bindToDocument();
-	},
-
-
-	// Unbinds DOM handlers from elements that reside outside the grid
-	unbindGlobalHandlers: function() {
-		ChronoComponent.prototype.unbindGlobalHandlers.apply(this, arguments);
-
-		this.externalDropping.unbindFromDocument();
-	},
-
-
 	bindDateHandlerToEl: function(el, name, handler) {
 	bindDateHandlerToEl: function(el, name, handler) {
 		var _this = this;
 		var _this = this;
 
 

+ 0 - 2
src/list/ListView.js

@@ -15,8 +15,6 @@ var ListView = View.extend(CoordChronoComponentMixin, SegChronoComponentMixin, {
 
 
 
 
 	initialize: function() {
 	initialize: function() {
-		// a requirement for CoordChronoComponentMixin
-		this.initCoordChronoComponent();
 
 
 		// a requirement for SegChronoComponentMixin
 		// a requirement for SegChronoComponentMixin
 		this.initSegChronoComponent();
 		this.initSegChronoComponent();