2
0
Adam Shaw 8 жил өмнө
parent
commit
5b74de5887

+ 5 - 1
src/View.js

@@ -764,9 +764,13 @@ View.watch('legacyDateProps', [ 'dateProfile' ], function(deps) {
 });
 
 
-View.watch('displayingBase', [ 'displayingDates' ], function(deps) {
+View.watch('displayingBase', [ 'dateProfile' ], function(deps) {
+	// consider the base rendered when it has received the date profile and an updateSize
+	// (which happens after the rendering queue is drained) has happened.
+	// it's hard to track when every subcomponent has rendered their dates.
 	this.whenSizeUpdated(this.triggerBaseRendered);
 }, function() {
+	// as soon as the view looses it's dateComponent, we know it will soon after unrender its dates.
 	this.triggerBaseUnrendered();
 });
 

+ 9 - 1
src/agenda/TimeGrid.js

@@ -650,7 +650,15 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 });
 
 
-TimeGrid.watch('displayingDates', [ 'dateProfile' ], function(deps) {
+TimeGrid.watch('displayingSlats', [ 'dateProfile' ], function(deps) {
 	this.requestRender(this.renderSlats, [ deps.dateProfile ], 'slats', 'destroy');
+});
+
+
+TimeGrid.watch('displayingColumns', [ 'dateProfile' ], function(deps) {
 	this.requestRender(this.renderColumns, [ deps.dateProfile ], 'columns', 'destroy');
 });
+
+
+TimeGrid.watch('displayingDates', [ 'displayingSlats', 'displayingColumns' ], function(deps) {
+});

+ 5 - 1
src/basic/DayGrid.js

@@ -386,8 +386,12 @@ var DayGrid = FC.DayGrid = InteractiveDateComponent.extend(StandardInteractionsM
 });
 
 
-DayGrid.watch('displayingDates', [ 'dateProfile' ], function(deps) {
+DayGrid.watch('displayingGrid', [ 'dateProfile' ], function(deps) {
 	this.requestRender(this.renderGrid, [ deps.dateProfile ], 'grid', 'destroy');
 }, function() {
 	this.requestRender(this.removeSegPopover);
 });
+
+
+DayGrid.watch('displayingDates', [ 'displayingGrid' ], function(deps) {
+});

+ 7 - 7
src/component/DateComponent.js

@@ -783,6 +783,13 @@ DateComponent.watch('businessHours', [ 'businessHourGenerator', 'dateProfile' ],
 });
 
 
+DateComponent.watch('eventDataSourceInChildren', [ 'eventDataSource' ], function(deps) {
+	this.setEventDataSourceInChildren(deps.eventDataSource);
+}, function(deps) {
+	this.unsetEventDataSourceInChildren(deps.eventDataSource);
+});
+
+
 DateComponent.watch('displayingDates', [ 'dateProfile' ], function(deps) {
 	this.requestRender(this.executeDateRender, [ deps.dateProfile ], 'date', 'destroy');
 }, function() {
@@ -804,13 +811,6 @@ DateComponent.watch('displayingEvents', [ 'displayingDates', 'eventDataSource' ]
 });
 
 
-DateComponent.watch('eventDataSourceInChildren', [ 'eventDataSource' ], function(deps) {
-	this.setEventDataSourceInChildren(deps.eventDataSource);
-}, function(deps) {
-	this.unsetEventDataSourceInChildren(deps.eventDataSource);
-});
-
-
 // legacy
 
 function convertEventInstanceHashToLegacyArray(eventInstancesByDefId) {