fix(scheduler): End should work even if the mouse isn't over a time

This commit is contained in:
Ben Gotow 2016-04-11 18:42:17 -07:00
parent 938e9b8093
commit 5f75cccc0f
2 changed files with 6 additions and 4 deletions

View file

@ -122,8 +122,11 @@ export default class ProposedTimePicker extends React.Component {
}
_onCalendarMouseUp({time, currentView}) {
if (!time || currentView !== NylasCalendar.WEEK_VIEW) { return }
SchedulerActions.endProposedTimeBlock(time);
if (currentView !== NylasCalendar.WEEK_VIEW) { return }
if (time) {
SchedulerActions.addToProposedTimeBlock(time);
}
SchedulerActions.endProposedTimeBlock();
return
}

View file

@ -137,8 +137,7 @@ class ProposedTimeCalendarStore extends NylasStore {
this._updateDragBuffer(newT.round(30, 'minutes'));
}
_onEndBlock = (newT) => {
this._updateDragBuffer(newT.ceil(30, 'minutes'));
_onEndBlock = () => {
this._convertBufferToProposedTimes()
this._resetDragBuffer();
this.trigger()