1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

fix public calendar filter

This commit is contained in:
Sylvain 2020-09-30 11:59:50 +02:00
parent c0a46e5bf1
commit f6183dbafb

View File

@ -55,9 +55,12 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
evt: filter.evt,
dispo: filter.dispo
});
$scope.eventSources = [{
// remove all
$scope.eventSources.splice(0, $scope.eventSources.length);
// recreate source for trainings/machines/events with new filters
$scope.eventSources.push({
url: availabilitySourceUrl()
}];
});
// external iCalendar events sources
$scope.externals.forEach(e => {
if (e.checked) {
@ -76,7 +79,7 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
}
}
});
uiCalendarConfig.calendars.calendar.fullCalendar('refetchEventSources');
uiCalendarConfig.calendars.calendar.fullCalendar('refetchEvents');
};
/**
@ -103,7 +106,7 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$
// toggle to select all formation/machine
$scope.toggleFilter = function (type, filter) {
$scope[type].forEach(t => t.checked = filter[type]);
return $scope.filterAvailabilities(filter, $scope);
$scope.filterAvailabilities(filter, $scope);
};
$scope.openFilterAside = () =>