Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a 'revert' function for FullCalendar

I have a calendar events that have custom properties one being isPublished which can be changed on the fly so I can't set the editable value to false. I am wondering how to cause an event to revert to its previous location on the calendar if it is marked isPublished.

eventDrop: function (event, jsEvent, ui, view){
            //event.start = dateAdd(d,dayDelta,event.start);
            if (event.isPublished == 0){
                addEditEvent(event);
            } else {
                revert: true;
                console.log('revert');
            }

        },

I see in the doc that there is a dragRevertDuration but I can't find the revert itself, is there one?

like image 782
Lance Avatar asked Oct 10 '22 03:10

Lance


1 Answers

yes it does, pretty simple

eventDrop: function (event, dayDelta, minuteDelta, allDay, revertFunc) {
    if (event.isPublished == 0){
        addEditEvent(event);
    } else {
        revertFunc();
        console.log('revert');
    }
}
like image 152
Kim Tranjan Avatar answered Oct 20 '22 06:10

Kim Tranjan