FullCalendar收缩没有事件的行

时间:2013-08-13 22:24:58

标签: fullcalendar

我正在尝试更换旧日历。我的旧日历的一个功能是如果连续存在没有事件,那么该行显示的非常小。这样可以保持日历的整体高度。

无论是否存在事件,fullcalendar的版本都要大得多。

如果给定的一周有一个事件,那么该行将达到正常大小。

有没有办法用fullcalendar完成这项工作,以避免在没有事件的情况下使用如此多的空间来完成日历?

感谢John 4d5,我的日历就是这样的:

Large Calendar

To This:

Small Calendar

1 个答案:

答案 0 :(得分:2)

在FullCalendar的lib中编辑函数setMinHeight。这是功能:

function setMinHeight(element, height) {
    height = (typeof height == 'number' ? height + 'px' : height);
    element.each(function(i, _element) {
        _element.style.cssText += ';min-height:' + height + ';_height:' + height;
    });
}

第四行更改为:

_element.style.cssText += ';min-height:' + 0 + ';_height:' + height;