grocy/public/viewjs/calendar.js
PhyberApex 4815388253
Removing of resize event
Hey,

I removed that resize event as it get's thrown every time you scroll on a mobile device. Which prevented me from actually viewing the list view of the calender on mobile devices.

Let me know if you think it is still needed tho!

~Cheers
2020-12-16 12:24:36 +01:00

46 lines
1.2 KiB
JavaScript

var firstDay = null;
if (!Grocy.CalendarFirstDayOfWeek.isEmpty())
{
firstDay = parseInt(Grocy.CalendarFirstDayOfWeek);
}
var calendar = $("#calendar").fullCalendar({
"themeSystem": "bootstrap4",
"header": {
"left": "month,agendaWeek,agendaDay,listWeek",
"center": "title",
"right": "prev,next"
},
"weekNumbers": Grocy.CalendarShowWeekNumbers,
"defaultView": ($(window).width() < 768) ? "agendaDay" : "month",
"firstDay": firstDay,
"eventLimit": false,
"height": "auto",
"eventSources": fullcalendarEventSources,
eventClick: function(info)
{
location.href = info.link;
}
});
$("#ical-button").on("click", function(e)
{
e.preventDefault();
Grocy.Api.Get('calendar/ical/sharing-link',
function(result)
{
bootbox.alert({
title: __t('Share/Integrate calendar (iCal)'),
message: __t('Use the following (public) URL to share or integrate the calendar in iCal format') + '<input type="text" class="form-control form-control-sm mt-2 easy-link-copy-textbox" value="' + result.url + '"><p class="text-center mt-4">'
+ getQRCodeForContent(result.url) + "</p>",
closeButton: false
});
},
function(xhr)
{
console.error(xhr);
}
);
});