' +
'' +
- '' +
- '' +
- ' | ' +
+ ' | ' +
'
' +
'' +
'';
@@ -11091,9 +11804,10 @@ var BasicView = FC.BasicView = View.extend({
setHeight: function(totalHeight, isAuto) {
var eventLimit = this.opt('eventLimit');
var scrollerHeight;
+ var scrollbarWidths;
// reset all heights to be natural
- unsetScroller(this.scrollerEl);
+ this.scroller.clear();
uncompensateScroll(this.headRowEl);
this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed
@@ -11103,6 +11817,8 @@ var BasicView = FC.BasicView = View.extend({
this.dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after
}
+ // distribute the height to the rows
+ // (totalHeight is a "recommended" value if isAuto)
scrollerHeight = this.computeScrollerHeight(totalHeight);
this.setGridHeight(scrollerHeight, isAuto);
@@ -11111,17 +11827,33 @@ var BasicView = FC.BasicView = View.extend({
this.dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set
}
- if (!isAuto && setPotentialScroller(this.scrollerEl, scrollerHeight)) { // using scrollbars?
+ if (!isAuto) { // should we force dimensions of the scroll container?
- compensateScroll(this.headRowEl, getScrollbarWidths(this.scrollerEl));
+ this.scroller.setHeight(scrollerHeight);
+ scrollbarWidths = this.scroller.getScrollbarWidths();
- // doing the scrollbar compensation might have created text overflow which created more height. redo
- scrollerHeight = this.computeScrollerHeight(totalHeight);
- this.scrollerEl.height(scrollerHeight);
+ if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?
+
+ compensateScroll(this.headRowEl, scrollbarWidths);
+
+ // doing the scrollbar compensation might have created text overflow which created more height. redo
+ scrollerHeight = this.computeScrollerHeight(totalHeight);
+ this.scroller.setHeight(scrollerHeight);
+ }
+
+ // guarantees the same scrollbar widths
+ this.scroller.lockOverflow(scrollbarWidths);
}
},
+ // given a desired total height of the view, returns what the height of the scroller should be
+ computeScrollerHeight: function(totalHeight) {
+ return totalHeight -
+ subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
+ },
+
+
// Sets the height of just the DayGrid component in this view
setGridHeight: function(height, isAuto) {
if (isAuto) {
@@ -11133,6 +11865,20 @@ var BasicView = FC.BasicView = View.extend({
},
+ /* Scroll
+ ------------------------------------------------------------------------------------------------------------------*/
+
+
+ queryScroll: function() {
+ return this.scroller.getScrollTop();
+ },
+
+
+ setScroll: function(top) {
+ this.scroller.setScrollTop(top);
+ },
+
+
/* Hit Areas
------------------------------------------------------------------------------------------------------------------*/
// forward all hit-related method calls to dayGrid
@@ -11368,6 +12114,8 @@ fcViews.month = {
var AgendaView = FC.AgendaView = View.extend({
+ scroller: null,
+
timeGridClass: TimeGrid, // class used to instantiate the timeGrid. subclasses can override
timeGrid: null, // the main time-grid subcomponent of this view
@@ -11377,11 +12125,10 @@ var AgendaView = FC.AgendaView = View.extend({
axisWidth: null, // the width of the time axis running down the side
headContainerEl: null, // div that hold's the timeGrid's rendered date header
- noScrollRowEls: null, // set of fake row elements that must compensate when scrollerEl has scrollbars
+ noScrollRowEls: null, // set of fake row elements that must compensate when scroller has scrollbars
// when the time-grid isn't tall enough to occupy the given height, we render an