From 5fa701235e9be75aea58bb899448f59d5781aacf Mon Sep 17 00:00:00 2001 From: jquense Date: Thu, 14 Jan 2016 13:36:54 -0500 Subject: [PATCH] [fixed] Incorrect gutter widths fixes #24, fixes #16 --- src/TimeGrid.jsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/TimeGrid.jsx b/src/TimeGrid.jsx index 9c17d921f..2864a5be6 100644 --- a/src/TimeGrid.jsx +++ b/src/TimeGrid.jsx @@ -208,22 +208,21 @@ let TimeGrid = React.createClass({ let gutterCells = [findDOMNode(this.refs.gutter), ...this._gutters] let isOverflowing = this.refs.content.scrollHeight > this.refs.content.clientHeight; - if (width) - gutterCells.forEach( - node => node.style.width = ''); + if (!width) { + this._gutterWidth = Math.max(...gutterCells.map(getWidth)); - this._gutterWidth = Math.max(...gutterCells.map(getWidth)); - - if (this._gutterWidth && width !== this._gutterWidth) { - width = this._gutterWidth + 'px'; - gutterCells.forEach(node => node.style.width = width) + if (this._gutterWidth) { + width = this._gutterWidth + 'px'; + gutterCells.forEach(node => node.style.width = width) + } } if (isOverflowing) { classes.addClass(header, 'rbc-header-overflowing') this.refs.headerCell.style[!isRtl ? 'marginLeft' : 'marginRight'] = ''; this.refs.headerCell.style[isRtl ? 'marginLeft' : 'marginRight'] = scrollbarSize() + 'px'; - } else { + } + else { classes.removeClass(header, 'rbc-header-overflowing') } }