Add mobile styling

This commit is contained in:
Jorit Tijsen
2024-03-20 12:31:55 +01:00
parent 04b4a3b3e5
commit 5b9dc7c7f3
26 changed files with 828 additions and 128 deletions

View File

@@ -80,7 +80,8 @@ $margin = 2;
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/air-datepicker@3.5.0/air-datepicker.min.js"></script>
<script type="text/javascript">
new AirDatepicker('#custom_date', {
var isMobile = window.screen.width <= 768;
var airdatepicker = new AirDatepicker('#custom_date', {
locale: {
days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
daysShort: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
@@ -95,6 +96,7 @@ $margin = 2;
},
selectedDates: [new Date()],
autoClose: true,
isMobile: isMobile,
onSelect: function onSelect(fd, date, inst) {
getCustomProgramDate();
}
@@ -117,5 +119,11 @@ $margin = 2;
});
}
}
jQuery(window).resize(function() {
if ((window.screen.width <= 768) != isMobile) {
isMobile = window.screen.width <= 768;
airdatepicker.update({isMobile: isMobile});
}
});
</script>
@endpush