Skip to content

Commit 5fa7012

Browse files
committed
[fixed] Incorrect gutter widths
fixes jquense#24, fixes jquense#16
1 parent 646b78c commit 5fa7012

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/TimeGrid.jsx

+8-9
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,21 @@ let TimeGrid = React.createClass({
208208
let gutterCells = [findDOMNode(this.refs.gutter), ...this._gutters]
209209
let isOverflowing = this.refs.content.scrollHeight > this.refs.content.clientHeight;
210210

211-
if (width)
212-
gutterCells.forEach(
213-
node => node.style.width = '');
211+
if (!width) {
212+
this._gutterWidth = Math.max(...gutterCells.map(getWidth));
214213

215-
this._gutterWidth = Math.max(...gutterCells.map(getWidth));
216-
217-
if (this._gutterWidth && width !== this._gutterWidth) {
218-
width = this._gutterWidth + 'px';
219-
gutterCells.forEach(node => node.style.width = width)
214+
if (this._gutterWidth) {
215+
width = this._gutterWidth + 'px';
216+
gutterCells.forEach(node => node.style.width = width)
217+
}
220218
}
221219

222220
if (isOverflowing) {
223221
classes.addClass(header, 'rbc-header-overflowing')
224222
this.refs.headerCell.style[!isRtl ? 'marginLeft' : 'marginRight'] = '';
225223
this.refs.headerCell.style[isRtl ? 'marginLeft' : 'marginRight'] = scrollbarSize() + 'px';
226-
} else {
224+
}
225+
else {
227226
classes.removeClass(header, 'rbc-header-overflowing')
228227
}
229228
}

0 commit comments

Comments
 (0)