Explorar o código

more handleDateProfileSet

Adam Shaw %!s(int64=8) %!d(string=hai) anos
pai
achega
fe1cc998f7
Modificáronse 4 ficheiros con 20 adicións e 19 borrados
  1. 17 16
      src/View.js
  2. 1 1
      src/agenda/TimeGrid.js
  3. 1 1
      src/basic/DayGrid.js
  4. 1 1
      src/list/ListView.js

+ 17 - 16
src/View.js

@@ -221,6 +221,22 @@ var View = FC.View = InteractiveDateComponent.extend({
 	},
 	},
 
 
 
 
+	handleDateProfileSet: function(dateProfile) {
+		InteractiveDateComponent.prototype.handleDateProfileSet.apply(this, arguments);
+
+		var calendar = this.calendar;
+
+		// DEPRECATED, but we need to keep it updated...
+		this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);
+		this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);
+		this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, dateProfile.isRangeAllDay);
+		this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, dateProfile.isRangeAllDay);
+
+		this.title = this.computeTitle(dateProfile);
+		calendar.reportViewDatesChanged(this, dateProfile); // TODO: reverse the pubsub
+	},
+
+
 	// Event Data
 	// Event Data
 	// -----------------------------------------------------------------------------------------------------------------
 	// -----------------------------------------------------------------------------------------------------------------
 
 
@@ -1014,22 +1030,7 @@ View.watch('bindingEvents', [ 'initialEvents' ], function(deps) {
 });
 });
 
 
 
 
-// misc & legacy conversion
-
-
-View.watch('dateProfileMisc', [ 'dateProfile' ], function(deps) {
-	var calendar = this.calendar;
-	var dateProfile = deps.dateProfile;
-
-	// DEPRECATED, but we need to keep it updated...
-	this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);
-	this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);
-	this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, dateProfile.isRangeAllDay);
-	this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, dateProfile.isRangeAllDay);
-
-	this.title = this.computeTitle(dateProfile);
-	calendar.reportViewDatesChanged(this, dateProfile); // TODO: reverse the pubsub
-});
+// legacy
 
 
 
 
 function convertEventsPayloadToLegacyArray(eventsPayload) {
 function convertEventsPayloadToLegacyArray(eventsPayload) {

+ 1 - 1
src/agenda/TimeGrid.js

@@ -75,7 +75,7 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 
 
 
 
 	handleDateProfileSet: function(dateProfile) {
 	handleDateProfileSet: function(dateProfile) {
-		InteractiveDateComponent.prototype.handleDateProfileSet.call(this, arguments);
+		InteractiveDateComponent.prototype.handleDateProfileSet.apply(this, arguments);
 
 
 		this.updateDayTable();
 		this.updateDayTable();
 
 

+ 1 - 1
src/basic/DayGrid.js

@@ -51,7 +51,7 @@ var DayGrid = FC.DayGrid = InteractiveDateComponent.extend(StandardInteractionsM
 
 
 
 
 	handleDateProfileSet: function(dateProfile) {
 	handleDateProfileSet: function(dateProfile) {
-		InteractiveDateComponent.prototype.handleDateProfileSet.call(this, arguments);
+		InteractiveDateComponent.prototype.handleDateProfileSet.apply(this, arguments);
 
 
 		this.updateDayTable();
 		this.updateDayTable();
 
 

+ 1 - 1
src/list/ListView.js

@@ -55,7 +55,7 @@ var ListView = View.extend({
 
 
 
 
 	handleDateProfileSet: function(dateProfile) {
 	handleDateProfileSet: function(dateProfile) {
-		View.prototype.handleDateProfileSet.call(this, arguments);
+		View.prototype.handleDateProfileSet.apply(this, arguments);
 
 
 		var calendar = this.calendar;
 		var calendar = this.calendar;
 		var dayStart = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);
 		var dayStart = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);