Skip to content

Commit

Permalink
fix: default height of task panel is too wide (fixes: #42)
Browse files Browse the repository at this point in the history
  • Loading branch information
youjung-hong committed Mar 26, 2018
1 parent 885968f commit 992aae3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/js/factory/weekView.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ module.exports = function(baseController, layoutContainer, dragHandler, options)
* 업무
**********/
taskView = new TaskView(options.week, vLayout.getPanelByName('Task').container);
taskView.on('afterRender', function(viewModel) {
vLayout.getPanelByName('Task').setHeight(null, viewModel.height);
taskView.on('afterRender', function() {
vLayout.getPanelByName('Task').setHeight(null, taskView.contentHeight);
});
weekView.addChild(taskView);
weekView.handler.click.task = new AlldayClick(dragHandler, taskView, baseController);
Expand Down
2 changes: 1 addition & 1 deletion src/js/view/week/allday.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Allday.prototype.render = function(viewModel) {
);
weekdayView.collapsed = this.collapsed;
weekdayView.on('afterRender', function(weekdayViewModel) {
self.contentHeight = weekdayViewModel.contentHeight + scheduleContainerTop;
self.contentHeight = weekdayViewModel.minHeight + scheduleContainerTop;
self.maxScheduleInDay = weekdayViewModel.maxScheduleInDay;
});

Expand Down
7 changes: 4 additions & 3 deletions src/js/view/week/weekdayInWeek.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
var util = require('tui-code-snippet');
var Weekday = require('../weekday'),
tmpl = require('./weekdayInWeek.hbs'),
dw = require('../../common/dw'),
datetime = require('../../common/datetime');
var mmax = Math.max,
mfloor = Math.floor,
Expand Down Expand Up @@ -85,7 +84,8 @@ WeekdayInWeek.prototype.render = function(viewModel) {
}

baseViewModel = this.getBaseViewModel(viewModel);
baseViewModel.contentHeight = this._getMinHeight(maxScheduleInDay);
baseViewModel.minHeight = this._getMinHeight(maxScheduleInDay);
baseViewModel.contentHeight = baseViewModel.minHeight;
baseViewModel.matrices = matrices;
baseViewModel.scheduleContainerTop = this.options.scheduleContainerTop;
baseViewModel.collapsed = (this.collapsed && (maxScheduleInDay > visibleScheduleCount)) ? 'collapsed' : '';
Expand All @@ -106,7 +106,8 @@ WeekdayInWeek.prototype._getMinHeight = function(maxScheduleInDay) {
var opt = this.options;

return (
(maxScheduleInDay * (opt.scheduleHeight + opt.scheduleGutter)) +
(maxScheduleInDay * opt.scheduleHeight) +
((maxScheduleInDay - 1) * opt.scheduleGutter) +
opt.containerBottomGutter
);
};
Expand Down

0 comments on commit 992aae3

Please sign in to comment.