From 0d4fe7e5e52e7b9bdfaac0e158e1fb18e6b44699 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Wed, 6 Apr 2016 13:03:27 -0700 Subject: [PATCH] fix(scheduler): fix time bar scroll height --- src/components/nylas-calendar/week-view.jsx | 8 ++++++++ static/components/nylas-calendar.less | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/nylas-calendar/week-view.jsx b/src/components/nylas-calendar/week-view.jsx index 26685c3b4..e29c6d918 100644 --- a/src/components/nylas-calendar/week-view.jsx +++ b/src/components/nylas-calendar/week-view.jsx @@ -76,6 +76,7 @@ export default class WeekView extends React.Component { componentDidUpdate() { const weekStart = moment(this.state.startMoment).add(BUFFER_DAYS, 'days').unix() this._scrollTime = weekStart + this._setIntervalHeight() this._ensureHorizontalScrollPos() } @@ -143,6 +144,9 @@ export default class WeekView extends React.Component { } _allDayEventHeight(allDayOverlap) { + if (_.size(allDayOverlap) === 0) { + return 0 + } return (this._maxConcurrentEvents(allDayOverlap) * MIN_INTERVAL_HEIGHT) + 1 } @@ -298,6 +302,10 @@ export default class WeekView extends React.Component { _setIntervalHeight = () => { const wrap = ReactDOM.findDOMNode(this.refs.eventGridWrap); const wrapHeight = wrap.getBoundingClientRect().height; + if (this._lastWrapHeight === wrapHeight) { + return + } + this._lastWrapHeight = wrapHeight; const numIntervals = Math.floor(DAY_DUR / INTERVAL_TIME); ReactDOM.findDOMNode(this.refs.eventGridLegendWrap).style.height = `${wrapHeight}px`; this.setState({ diff --git a/static/components/nylas-calendar.less b/static/components/nylas-calendar.less index d596f64dd..0e9af990a 100644 --- a/static/components/nylas-calendar.less +++ b/static/components/nylas-calendar.less @@ -97,7 +97,6 @@ width: auto; z-index: 2; overflow: hidden; - transition: height ease-in-out 200ms; } .all-day-legend {