Adam Shaw 8 лет назад
Родитель
Сommit
8598ea2c8a

+ 0 - 8
src/agenda/AgendaView.js

@@ -67,12 +67,6 @@ var AgendaView = FC.AgendaView = View.extend({
 	// Renders the view into `this.el`, which has already been assigned
 	renderDates: function() {
 
-		this.timeGrid.rangeUpdated();
-
-		if (this.dayGrid) {
-			this.dayGrid.rangeUpdated();
-		}
-
 		this.el.addClass('fc-agenda-view').html(this.renderSkeletonHtml());
 		this.renderHead();
 
@@ -82,7 +76,6 @@ var AgendaView = FC.AgendaView = View.extend({
 		this.el.find('.fc-body > tr > td').append(timeGridWrapEl);
 
 		this.timeGrid.setElement(timeGridEl);
-		this.timeGrid.renderDates();
 
 		// the <hr> that sometimes displays under the time-grid
 		this.bottomRuleEl = $('<hr class="fc-divider ' + this.calendar.theme.getClass('widgetHeader') + '"/>')
@@ -90,7 +83,6 @@ var AgendaView = FC.AgendaView = View.extend({
 
 		if (this.dayGrid) {
 			this.dayGrid.setElement(this.el.find('.fc-day-grid'));
-			this.dayGrid.renderDates();
 
 			// have the day-grid extend it's coordinate area over the <hr> dividing the two grids
 			this.dayGrid.bottomCoordPadding = this.dayGrid.el.next('hr').outerHeight();

+ 2 - 2
src/agenda/TimeGrid.js

@@ -74,8 +74,8 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 	------------------------------------------------------------------------------------------------------------------*/
 
 
-	rangeUpdated: function() {
-		var dateProfile = this.get('dateProfile');
+	handleDateProfileSet: function(dateProfile) {
+		InteractiveDateComponent.prototype.handleDateProfileSet.call(this, arguments);
 
 		this.updateDayTable();
 

+ 0 - 1
src/basic/BasicView.js

@@ -69,7 +69,6 @@ var BasicView = FC.BasicView = View.extend({
 		var dateProfile = this.get('dateProfile');
 
 		this.dayGrid.breakOnWeeks = /year|month|week/.test(dateProfile.currentRangeUnit);
-		this.dayGrid.rangeUpdated();
 
 		this.dayNumbersVisible = this.dayGrid.rowCnt > 1; // TODO: make grid responsible
 		if (this.opt('weekNumbers')) {

+ 3 - 1
src/basic/DayGrid.js

@@ -50,7 +50,9 @@ var DayGrid = FC.DayGrid = InteractiveDateComponent.extend(StandardInteractionsM
 	},
 
 
-	rangeUpdated: function() {
+	handleDateProfileSet: function(dateProfile) {
+		InteractiveDateComponent.prototype.handleDateProfileSet.call(this, arguments);
+
 		this.updateDayTable();
 
 		// needs to go after updateDayTable because computeEventTimeFormat/computeDisplayEventEnd depends on colCnt.

+ 13 - 3
src/component/DateComponent.js

@@ -87,6 +87,16 @@ var DateComponent = Component.extend({
 	// -----------------------------------------------------------------------------------------------------------------
 
 
+	handleDateProfileSet: function(dateProfile) {
+		this.setDateProfileInChildren(dateProfile);
+	},
+
+
+	handleDateProfileUnset: function() {
+		this.unsetDateProfileInChildren();
+	},
+
+
 	setDateProfileInChildren: function(dateProfile) {
 		this.setInChildren('dateProfile', dateProfile);
 	},
@@ -684,10 +694,10 @@ var DateComponent = Component.extend({
 DateComponent.guid = 0; // TODO: better system for this?
 
 
-DateComponent.watch('dateProfileInChildren', [ 'dateProfile' ], function(deps) {
-	this.setDateProfileInChildren(deps.dateProfile);
+DateComponent.watch('handleDateProfile', [ 'dateProfile' ], function(deps) {
+	this.handleDateProfileSet(deps.dateProfile);
 }, function() {
-	this.unsetDateProfileInChildren();
+	this.handleDateProfileUnset();
 });
 
 

+ 3 - 2
src/list/ListView.js

@@ -54,9 +54,10 @@ var ListView = View.extend({
 	},
 
 
-	renderDates: function() {
+	handleDateProfileSet: function(dateProfile) {
+		View.prototype.handleDateProfileSet.call(this, arguments);
+
 		var calendar = this.calendar;
-		var dateProfile = this.get('dateProfile');
 		var dayStart = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);
 		var viewEnd = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, true);
 		var dayDates = [];