2
0
Эх сурвалжийг харах

bindGlobalHandlers to ChronoComponent

Adam Shaw 8 жил өмнө
parent
commit
9378eeceee

+ 10 - 0
src/common/ChronoComponent.js

@@ -48,6 +48,7 @@ var ChronoComponent = Model.extend({
 	// and renders all the non-date-related content inside.
 	// and renders all the non-date-related content inside.
 	setElement: function(el) {
 	setElement: function(el) {
 		this.el = el;
 		this.el = el;
+		this.bindGlobalHandlers();
 		this.renderSkeleton();
 		this.renderSkeleton();
 	},
 	},
 
 
@@ -57,6 +58,7 @@ var ChronoComponent = Model.extend({
 	removeElement: function() {
 	removeElement: function() {
 		this.unsetDate();
 		this.unsetDate();
 		this.unrenderSkeleton();
 		this.unrenderSkeleton();
+		this.unbindGlobalHandlers();
 
 
 		this.el.remove();
 		this.el.remove();
 		// NOTE: don't null-out this.el in case the View was destroyed within an API callback.
 		// NOTE: don't null-out this.el in case the View was destroyed within an API callback.
@@ -65,6 +67,14 @@ var ChronoComponent = Model.extend({
 	},
 	},
 
 
 
 
+	bindGlobalHandlers: function() {
+	},
+
+
+	unbindGlobalHandlers: function() {
+	},
+
+
 	// Skeleton
 	// Skeleton
 	// -----------------------------------------------------------------------------------------------------------------
 	// -----------------------------------------------------------------------------------------------------------------
 
 

+ 0 - 2
src/common/View.js

@@ -199,13 +199,11 @@ var View = FC.View = ChronoComponent.extend({
 	setElement: function(el) {
 	setElement: function(el) {
 		ChronoComponent.prototype.setElement.apply(this, arguments);
 		ChronoComponent.prototype.setElement.apply(this, arguments);
 
 
-		this.bindGlobalHandlers();
 		this.bindBaseRenderHandlers();
 		this.bindBaseRenderHandlers();
 	},
 	},
 
 
 
 
 	removeElement: function() {
 	removeElement: function() {
-		this.unbindGlobalHandlers();
 		this.unbindBaseRenderHandlers();
 		this.unbindBaseRenderHandlers();
 
 
 		ChronoComponent.prototype.removeElement.apply(this, arguments);
 		ChronoComponent.prototype.removeElement.apply(this, arguments);