I'm sort of self-teaching myself through trial and error, lots of errors :) I'm stuck. I am using fullCalendar which is working great from JSON feeds.
I want to drag external events to the calendar and depending on the event dragged, show a different modal. The event drop and modal show is working, except its opening both (vacation on top of repair) every time.
<div id="external-events">
<div id="vacationdrop" class="fc-event vacation" className="vacation">Vacation</div>
<div id="repairdrop" class="fc-event repair" className="repair">Repair</div
</div>
The event drop:
drop: function() {
if (jQuery('#external-events .fc-event').hasClass('repair') {
var territory = jQuery(terrDropdown).find(':selected').text();
var start = moment(start).format("YYYY-MM-DD");
var end = moment(end).format("YYYY-MM-DD");
jQuery('#calendarRepairModal #startdate').val(start);
jQuery('#calendarRepairModal #enddate').val(end);
jQuery('#calendarRepairModal #terr').val(territory);
jQuery("#calendarRepairModal").modal("show");
}
};
else {
if (jQuery('#external-events .fc-event').hasClass('vacation') {
var territory = jQuery(terrDropdown).find(':selected').text();
var start = moment(start).format("YYYY-MM-DD");
var end = moment(end).format("YYYY-MM-DD");
jQuery('#calendarVacationModal #startdate').val(start);
jQuery('#calendarVacationModal #enddate').val(end);
jQuery('#calendarVacationModal #terr').val(territory);
jQuery("#calendarVacationModal").modal("show");
};)
},
Any help would be appreciated. I did search quite extensively but nothing that resembles my objective. Also, I've written jQuery out each time because I'm also using wordpress, and its finicky.