Ver código fonte

dont use initialize method anymore

Adam Shaw 8 anos atrás
pai
commit
3869356f7a
5 arquivos alterados com 13 adições e 16 exclusões
  1. 0 6
      src/Calendar.js
  2. 3 1
      src/agenda/AgendaView.js
  3. 3 1
      src/basic/BasicView.js
  4. 4 7
      src/common/View.js
  5. 3 1
      src/list/ListView.js

+ 0 - 6
src/Calendar.js

@@ -24,12 +24,6 @@ var Calendar = FC.Calendar = Class.extend(EmitterMixin, {
 		this.initEventManager();
 
 		EventManager.call(this); // needs options immediately
-		this.initialize();
-	},
-
-
-	// Subclasses can override this for initialization logic after the constructor has been called
-	initialize: function() {
 	},
 
 

+ 3 - 1
src/agenda/AgendaView.js

@@ -26,7 +26,9 @@ var AgendaView = FC.AgendaView = View.extend({
 	usesMinMaxTime: true,
 
 
-	initialize: function() {
+	constructor: function() {
+		View.apply(this, arguments);
+
 		this.timeGrid = this.instantiateTimeGrid();
 		this.addChild(this.timeGrid);
 

+ 3 - 1
src/basic/BasicView.js

@@ -21,7 +21,9 @@ var BasicView = FC.BasicView = View.extend({
 	headRowEl: null, // the fake row element of the day-of-week header
 
 
-	initialize: function() {
+	constructor: function() {
+		View.apply(this, arguments);
+
 		this.dayGrid = this.instantiateDayGrid();
 		this.addChild(this.dayGrid);
 

+ 4 - 7
src/common/View.js

@@ -55,7 +55,10 @@ var View = FC.View = InteractiveChronoComponent.extend({
 		this.renderQueue = this.buildRenderQueue();
 		this.initAutoBatchRender();
 
-		this.initialize();
+		// legacy
+		if (this.initialize) {
+			this.initialize();
+		}
 	},
 
 
@@ -111,12 +114,6 @@ var View = FC.View = InteractiveChronoComponent.extend({
 	},
 
 
-	// A good place for subclasses to initialize member variables
-	initialize: function() {
-		// subclasses can implement
-	},
-
-
 	// Retrieves an option with the given name
 	opt: function(name) {
 		return this.options[name];

+ 3 - 1
src/list/ListView.js

@@ -15,7 +15,9 @@ var ListView = View.extend({
 	dayRanges: null, // UnzonedRange[], of start-end of each day
 
 
-	initialize: function() {
+	constructor: function() {
+		View.apply(this, arguments);
+
 		this.scroller = new Scroller({
 			overflowX: 'hidden',
 			overflowY: 'auto'