- clientHeight;
-
- if (!me.collapsed && me.view && me.view.el) {
- viewElDom = me.view.el.dom;
- //centerScrollWidth = viewElDom.scrollWidth;
- centerScrollWidth = me.headerCt.getFullWidth();
- /**
- * clientWidth often returns 0 in IE resulting in an
- * infinity result, here we use offsetWidth bc there are
- * no possible scrollbars and we don't care about margins
- */
- centerClientWidth = viewElDom.offsetWidth;
- if (me.verticalScroller && me.verticalScroller.el) {
- scrollHeight = me.verticalScroller.getSizeCalculation().height;
+ clientHeight,
+ verticalScroller = me.verticalScroller,
+ horizontalScroller = me.horizontalScroller,
+ curScrollbars = (verticalScroller && verticalScroller.ownerCt === me ? 1 : 0) |
+ (horizontalScroller && horizontalScroller.ownerCt === me ? 2 : 0),
+ reqScrollbars = 0; // 1 = vertical, 2 = horizontal, 3 = both
+
+ // If we are not collapsed, and the view has been rendered AND filled, then we can determine scrollbars
+ if (!me.collapsed && me.view && me.view.el && me.view.el.dom.firstChild) {
+
+ // Calculate maximum, *scrollbarless* space which the view has available.
+ // It will be the Fit Layout's calculated size, plus the widths of any currently shown scrollbars
+ box = me.layout.getLayoutTargetSize();
+ clientWidth = box.width + ((curScrollbars & 1) ? verticalScroller.width : 0);
+ clientHeight = box.height + ((curScrollbars & 2) ? horizontalScroller.height : 0);
+
+ // Calculate the width of the scrolling block
+ // There will never be a horizontal scrollbar if all columns are flexed.
+
+ scrollWidth = (me.headerCt.query('[flex]').length && !me.headerCt.layout.tooNarrow) ? 0 : me.headerCt.getFullWidth();
+
+ // Calculate the height of the scrolling block
+ if (verticalScroller && verticalScroller.el) {
+ scrollHeight = verticalScroller.getSizeCalculation().height;