mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 17:33:19 +03:00
Removed the onDayClick callback in table view as it is not needed.
This commit is contained in:
parent
0da88a7729
commit
30381b5c86
1 changed files with 4 additions and 40 deletions
|
@ -574,8 +574,10 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
||||||
return matches.length;
|
return matches.length;
|
||||||
});
|
});
|
||||||
|
|
||||||
return (!filterProviderIds.length && !filterServiceIds.length) || servedServiceIds.length
|
return (!filterProviderIds.length && !filterServiceIds.length)
|
||||||
|| filterProviderIds.indexOf(provider.id) !== -1;
|
|| (filterProviderIds.length && !filterServiceIds.length && filterProviderIds.indexOf(provider.id) !== -1)
|
||||||
|
|| (!filterProviderIds.length && filterServiceIds.length && servedServiceIds.length)
|
||||||
|
|| (filterProviderIds.length && filterServiceIds.length && servedServiceIds.length && filterProviderIds.indexOf(provider.id) !== -1);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (GlobalVariables.user.role_slug === 'provider') {
|
if (GlobalVariables.user.role_slug === 'provider') {
|
||||||
|
@ -792,7 +794,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
||||||
eventClick: onEventClick,
|
eventClick: onEventClick,
|
||||||
eventResize: onEventResize,
|
eventResize: onEventResize,
|
||||||
eventDrop: onEventDrop,
|
eventDrop: onEventDrop,
|
||||||
dayClick: onDayClick,
|
|
||||||
viewRender: onViewRender
|
viewRender: onViewRender
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -804,43 +805,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
||||||
.prependTo($providerColumn);
|
.prependTo($providerColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Calendar Day "Click" Callback
|
|
||||||
*
|
|
||||||
* When the user clicks on a day square on the calendar, then he will automatically be transferred to that
|
|
||||||
* day view calendar.
|
|
||||||
*/
|
|
||||||
function onDayClick(date) {
|
|
||||||
$('#insert-appointment').trigger('click');
|
|
||||||
|
|
||||||
var $dialog = $('#manage-appointment');
|
|
||||||
|
|
||||||
var providerId = $(this).closest('.provider-column').data('provider').id;
|
|
||||||
|
|
||||||
var provider = GlobalVariables.availableProviders.find(function (provider) {
|
|
||||||
return Number(provider.id) === Number(providerId);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!provider) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var service = GlobalVariables.availableServices.find(function (service) {
|
|
||||||
return provider.services.indexOf(service.id) !== -1;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (provider.services.length) {
|
|
||||||
$dialog.find('#select-service').val([provider.services[0]]).trigger('change');
|
|
||||||
$dialog.find('#select-provider').val(provider.id);
|
|
||||||
|
|
||||||
$dialog.find('#start-datetime').val(GeneralFunctions.formatDate(date, GlobalVariables.dateFormat, true));
|
|
||||||
$dialog.find('#start-datetime').datepicker('setDate', date);
|
|
||||||
$dialog.find('#end-datetime').val(GeneralFunctions.formatDate(date.addMinutes(service.duration),
|
|
||||||
GlobalVariables.dateFormat, true));
|
|
||||||
$dialog.find('#end-datetime').datepicker('setDate', date);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onViewRender(view, element) {
|
function onViewRender(view, element) {
|
||||||
$(element).fullCalendar('option', 'height', getCalendarHeight());
|
$(element).fullCalendar('option', 'height', getCalendarHeight());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue