FullCalendar Select没有'如果使用fullcalendar.js而不是fullcalendar

FullCalendar Select doesn't work if using fullcalendar.js instead of fullcalendar.min.js

本文关键字:fullcalendar js 如果 没有 Select FullCalendar      更新时间:2023-09-26

全部,我使用的是fullcalendar下载中的示例,但我想使用fullcalendar.js而不是fullcalendar.min.js。当我进行此更改时,尽管选择选项不起作用(我无法选择任何时间范围,弹出窗口也不会出现)。

有什么想法需要在fullcalender.js文件中更改什么才能使其工作吗?

编辑我使用以下代码进行选择:

selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
    var title = prompt('Event Title:');
    calendar.fullCalendar('unselect');
},

编辑#2问题似乎与selectHelper有关。如果我评论掉那个部分,我可以选择我想使用的时间,但它没有很好的覆盖。以下是fullcalendar.js中的代码:

function renderSlotSelection(startDate, endDate) {
    var helperOption = opt('selectHelper');
    coordinateGrid.build();
    if (helperOption) {
        var col = dayDiff(startDate, t.visStart) * dis + dit;
        if (col >= 0 && col < colCnt) { // only works when times are on same day
            var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only for horizontal coords
            var top = timePosition(startDate, startDate);
            var bottom = timePosition(startDate, endDate);
            if (bottom > top) { // protect against selections that are entirely before or after visible range
                rect.top = top;
                rect.height = bottom - top;
                rect.left += 2;
                rect.width -= 5;
                if ($.isFunction(helperOption)) {
                    var helperRes = helperOption(startDate, endDate);
                    if (helperRes) {
                        rect.position = 'absolute';
                        rect.zIndex = 8;
                        selectionHelper = $(helperRes)
                            .css(rect)
                            .appendTo(slotContent);
                    }
                }else{
                    rect.isStart = true; // conside rect a "seg" now
                    rect.isEnd = true;   //
                    selectionHelper = $(slotSegHtml(
                        {
                            title: '',
                            start: startDate,
                            end: endDate,
                            className: ['fc-select-helper'],
                            editable: false
                        },
                        rect
                    ));
                    selectionHelper.css('opacity', opt('dragOpacity'));
                }
                if (selectionHelper) {
                    slotBind(selectionHelper);
                    slotContent.append(selectionHelper);
                    setOuterWidth(selectionHelper, rect.width, true); // needs to be after appended
                    setOuterHeight(selectionHelper, rect.height, true);
                }
            }
        }
    }else{
        renderSlotOverlay(startDate, endDate);
    }
}

我不知道为什么这不起作用,但事实并非如此。有什么改变的想法吗?

提前感谢!

这看起来是一个更大的问题,这个问题围绕着jQuery如何做事的一个新问题。此问题是由正则表达式的更改引起的,该正则表达式用于规范event对象中的"鼠标事件属性":https://github.com/jquery/jquery/blob/master/src/event.js#L7

这里有一个线程来监控这个解决方案:

http://code.google.com/p/fullcalendar/issues/detail?id=1168

但是,此修复程序在IE中不起作用。