So I recently added a context menu to the events in my FullCalendar using jQuery contextMenu (http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin/). It works beautifully, except that my dragging/dropping ability stopped working properly, when you drag an event and let go over another date the event date isn't changed, and it redirects to the event's url. I did some checking, and realized that eventDrop, eventDragStart, and eventClick all aren't being fired. If I comment out the context menu everything works fine. If anyone can figure out why contextMenu is preventing the fullCalendar callbacks from being fired I'd appreciate it, since contextMenu suits my needs perfectly otherwise. Code for contextMenu and event callbacks:
eventRender: function(event, element) {
if (event.url.indexOf("https://www.google.com") != 0)
{
element.contextMenu({
menu: "myMenu",
},
function(action, el) {
if (action == "approve") {
$.ajax({
url: 'events/' + event.id,
data: { 'event' : { 'status' : "Approved", } },
type: "PUT",
}),
$('#calendar').fullCalendar('refetchEvents');
} else if (action == "deny") {
$.ajax({
url: 'events/' + event.id,
data: { 'event' : { 'status' : "Denied", } },
type: "PUT",
}),
$('#calendar').fullCalendar('refetchEvents');
} else if (action == "destroy") {
if (confirm("Are you sure you want to delete this event?") ) {
$.ajax({
url: 'events/' + event.id,
type: "DELETE",
}),
$('#calendar').fullCalendar('refetchEvents');
}
}
else if (action == "edit") {
window.location = 'events/' + event.id + '/edit'
}
}
);
}
},
eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc){
updateEvent(event);
},
eventResize: function(event, dayDelta, minuteDelta, revertFunc){
updateEvent(event);
},
eventClick: function(event) {
if (event.url.indexOf("https://www.google.com") != 0) {
$.facebox(function() {
$.get('events/' + event.id,
function(data) {
$.facebox(data)
}
);
})
return false;
}
return false;
}