Add mobile styling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user