mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
Update calendar.js
Now it only get's called once :)
This commit is contained in:
parent
4815388253
commit
d8149e22c1
|
|
@ -1,4 +1,5 @@
|
|||
var firstDay = null;
|
||||
var resized = false;
|
||||
if (!Grocy.CalendarFirstDayOfWeek.isEmpty())
|
||||
{
|
||||
firstDay = parseInt(Grocy.CalendarFirstDayOfWeek);
|
||||
|
|
@ -43,3 +44,17 @@ $("#ical-button").on("click", function(e)
|
|||
}
|
||||
);
|
||||
});
|
||||
|
||||
$(window).one("resize", function()
|
||||
{
|
||||
// Automatically switch the calendar to "basicDay" view on small screens
|
||||
// and to "month" otherwise
|
||||
if ($(window).width() < 768)
|
||||
{
|
||||
calendar.fullCalendar("changeView", "agendaDay");
|
||||
}
|
||||
else
|
||||
{
|
||||
calendar.fullCalendar("changeView", "month");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user