Răsfoiți Sursa

fixes for time/day grid sizing

Adam Shaw 8 ani în urmă
părinte
comite
4be620ff0e
4 a modificat fișierele cu 18 adăugiri și 8 ștergeri
  1. 8 6
      src/agenda/AgendaView.js
  2. 3 0
      src/agenda/TimeGrid.js
  3. 4 2
      src/basic/BasicView.js
  4. 3 0
      src/basic/DayGrid.js

+ 8 - 6
src/agenda/AgendaView.js

@@ -151,7 +151,14 @@ var AgendaView = FC.AgendaView = View.extend({
 		var scrollerHeight;
 		var scrollerHeight;
 		var scrollbarWidths;
 		var scrollbarWidths;
 
 
-		if (!this.isDatesRendered) { // hack
+		View.prototype.updateSize.apply(this, arguments);
+
+		// make all axis cells line up, and record the width so newly created axis cells will have it
+		this.axisWidth = matchCellWidths(this.el.find('.fc-axis'));
+
+		// hack to give the view some height prior to timeGrid's columns being rendered
+		// TODO: separate setting height from scroller VS timeGrid.
+		if (!this.timeGrid.isDatesRendered) {
 			if (!isAuto) {
 			if (!isAuto) {
 				scrollerHeight = this.computeScrollerHeight(totalHeight);
 				scrollerHeight = this.computeScrollerHeight(totalHeight);
 				this.scroller.setHeight(scrollerHeight);
 				this.scroller.setHeight(scrollerHeight);
@@ -159,11 +166,6 @@ var AgendaView = FC.AgendaView = View.extend({
 			return;
 			return;
 		}
 		}
 
 
-		View.prototype.updateSize.apply(this, arguments);
-
-		// make all axis cells line up, and record the width so newly created axis cells will have it
-		this.axisWidth = matchCellWidths(this.el.find('.fc-axis'));
-
 		// set of fake row elements that must compensate when scroller has scrollbars
 		// set of fake row elements that must compensate when scroller has scrollbars
 		var noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)');
 		var noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)');
 
 

+ 3 - 0
src/agenda/TimeGrid.js

@@ -661,4 +661,7 @@ TimeGrid.watch('displayingColumns', [ 'dateProfile' ], function(deps) {
 
 
 
 
 TimeGrid.watch('displayingDates', [ 'displayingSlats', 'displayingColumns' ], function(deps) {
 TimeGrid.watch('displayingDates', [ 'displayingSlats', 'displayingColumns' ], function(deps) {
+	this.isDatesRendered = true;
+}, function() {
+	this.isDatesRendered = false;
 });
 });

+ 4 - 2
src/basic/BasicView.js

@@ -146,11 +146,13 @@ var BasicView = FC.BasicView = View.extend({
 	// Refreshes the horizontal dimensions of the view
 	// Refreshes the horizontal dimensions of the view
 	updateSize: function(totalHeight, isAuto, isResize) {
 	updateSize: function(totalHeight, isAuto, isResize) {
 		var eventLimit = this.opt('eventLimit');
 		var eventLimit = this.opt('eventLimit');
-		var headRowEl = this.dayGrid.headContainerEl.find('.fc-row')
+		var headRowEl = this.dayGrid.headContainerEl.find('.fc-row');
 		var scrollerHeight;
 		var scrollerHeight;
 		var scrollbarWidths;
 		var scrollbarWidths;
 
 
-		if (!this.isDatesRendered) { // hack
+		// hack to give the view some height prior to dayGrid's columns being rendered
+		// TODO: separate setting height from scroller VS dayGrid.
+		if (!this.dayGrid.isDatesRendered) {
 			if (!isAuto) {
 			if (!isAuto) {
 				scrollerHeight = this.computeScrollerHeight(totalHeight);
 				scrollerHeight = this.computeScrollerHeight(totalHeight);
 				this.scroller.setHeight(scrollerHeight);
 				this.scroller.setHeight(scrollerHeight);

+ 3 - 0
src/basic/DayGrid.js

@@ -394,4 +394,7 @@ DayGrid.watch('displayingGrid', [ 'dateProfile' ], function(deps) {
 
 
 
 
 DayGrid.watch('displayingDates', [ 'displayingGrid' ], function(deps) {
 DayGrid.watch('displayingDates', [ 'displayingGrid' ], function(deps) {
+	this.isDatesRendered = true;
+}, function() {
+	this.isDatesRendered = false;
 });
 });