mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-04 07:10:06 +08:00
fix(scheduler): fix time bar scroll height
This commit is contained in:
parent
0aa8aeb70f
commit
0d4fe7e5e5
2 changed files with 8 additions and 1 deletions
|
@ -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({
|
||||
|
|
|
@ -97,7 +97,6 @@
|
|||
width: auto;
|
||||
z-index: 2;
|
||||
overflow: hidden;
|
||||
transition: height ease-in-out 200ms;
|
||||
}
|
||||
|
||||
.all-day-legend {
|
||||
|
|
Loading…
Reference in a new issue