fullcalendar selectHelper在调整到限制区域时隐藏

时间:2018-10-16 20:49:42

标签: fullcalendar

将selecthelper调整为限制区域(selectConstraint)时的默认行为是隐藏selectHelper,我希望这与将事件调整为限制区域(eventConstraint)时的大小完全相同,在该区域中事件可见,大小为最后允许的大小。

这是演示 http://jsfiddle.net/pu83thf9/3/

1)尝试从上午10点到下午2点进行选择,selectHelper隐藏在selectConstraint中 2)尝试创建一个从8到10的事件,尝试将其调整为12,并且不松开鼠标2秒钟,现在尝试将其调整为2pm,它像情况1一样可见且不隐藏

$(document).ready(function(){

$('#calendar').fullCalendar({
  header: {
    left: 'prev,next today',
    center: 'title',
    right: 'month,agendaWeek,agendaDay'
  },
  locale:"en",
  minTime: "06:00:00",
  maxTime: "20:00:00",
  allDaySlot: false,
  businessHours: true,

businessHours: [{
      dow: [1, 2, 3, 4, 5], // Monday - Friday
      start: '08:00',
      end: '12:00',
    }, {
      dow: [1, 2, 3, 4, 5], // Monday - Friday (if adding lunch hours)
      start: '13:00',
      end: '17:00',
    }],
    selectConstraint: "businessHours",  
eventConstraint: "businessHours",   
    defaultView: 'agendaWeek',
  defaultDate: '2018-03-12',
  navLinks: true, // can click day/week names to navigate views
  selectable: true,
  selectHelper: true,

    select: function(start, end) {

    var title = 'Zone';
    var eventData;
    if (title) {
      eventData = {
        title: title,
        start: start,
        end: end
      };
      $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
    }
    $('#calendar').fullCalendar('unselect');
  },
  editable: true,
  eventOverlap :false,
  selectOverlap :false,

  eventLimit: true, // allow "more" link when too many events
    eventRender: function (event, element, view) {


        element.find(".closeon").on('click', function () {
            $('#calendar').fullCalendar('removeEvents', event._id);
        });}
});

  });

0 个答案:

没有答案