I have a full customized lightbox for my scheduler. I attached event on event collision.
scheduler.attachEvent("onEventCollision", function (ev, evs) {
var c = 0, l = scheduler.config.collision_limit;
var patientId = ev.PatientId == '' ? '0' : ev.PatientId;
for (var i = 0; i < evs.length; i++) {
if ((ev.UserId == evs[i].UserId) && ev.id != evs[i].id) //&& patientId == evs[i].PatientId
c++;
}
//validateOverlappingEvent();
if (c < 1) {
return true;
} else {
if (confirm("This appointment has conflict with other scheduler.\nAre you sure you want to double book?")) {
var x = 0;
for (var a = 0; a < evs.length; a++) {
if ((ev.UserId == evs[a].UserId) && ev.id != evs[a].id && patientId == evs[a].PatientId)
x++;
}
if (x < 1) {
return false;
} else {
validateOverlappingEvent();
return true;
}
} else {
return true;
}
}
//return !(c < l);
});
Everytime I create or edit an event which has conflict to other event this will prompt user. The problem is when the user create a new event or edit existing event and choose start date and end date that conflict to other event and saved it, it still prompt the user and when the user choose to cancel the double booking the lightbox close. To prevent this I need to know if the lightbox is still open or not.
Is there any way to check if the lightbox is still open or not?