fix datepicker appears out of screen (#2610)

This commit is contained in:
Kevin Papst
2021-06-10 15:51:26 +02:00
committed by GitHub
parent 7f20cb045c
commit 0b519e9d08
8 changed files with 25 additions and 4 deletions

View File

@@ -45,6 +45,13 @@ export default class KimaiDatePicker extends KimaiPlugin {
}
});
jQuery(this).on('show.daterangepicker', function (ev, picker) {
if (picker.element.offset().top - jQuery(window).scrollTop() + picker.container.outerHeight() + 30 > jQuery(window).height()) {
picker.drops = 'up';
picker.move();
}
});
jQuery(this).on('apply.daterangepicker', function(ev, picker) {
jQuery(this).val(picker.startDate.format(localeFormat));
jQuery(this).trigger("change");

View File

@@ -66,6 +66,13 @@ export default class KimaiDateRangePicker extends KimaiPlugin {
alwaysShowCalendars: true
});
jQuery(this).on('show.daterangepicker', function (ev, picker) {
if (picker.element.offset().top - jQuery(window).scrollTop() + picker.container.outerHeight() + 30 > jQuery(window).height()) {
picker.drops = 'up';
picker.move();
}
});
jQuery(this).on('apply.daterangepicker', function(ev, picker) {
jQuery(this).val(picker.startDate.format(localeFormat) + ' - ' + picker.endDate.format(localeFormat));
jQuery(this).data('begin', picker.startDate.format(localeFormat));

View File

@@ -48,6 +48,13 @@ export default class KimaiDateTimePicker extends KimaiPlugin {
}
});
jQuery(this).on('show.daterangepicker', function (ev, picker) {
if (picker.element.offset().top - jQuery(window).scrollTop() + picker.container.outerHeight() + 30 > jQuery(window).height()) {
picker.drops = 'up';
picker.move();
}
});
jQuery(this).on('apply.daterangepicker', function(ev, picker) {
jQuery(this).val(picker.startDate.format(localeFormat));
jQuery(this).trigger("change");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
"app": {
"js": [
"build/runtime.b8e7bb04.js",
"build/app.3b90b56b.js"
"build/app.1cecb23c.js"
],
"css": [
"build/app.cf7b7f85.css"

View File

@@ -1,6 +1,6 @@
{
"build/app.css": "build/app.cf7b7f85.css",
"build/app.js": "build/app.3b90b56b.js",
"build/app.js": "build/app.1cecb23c.js",
"build/invoice.css": "build/invoice.ff32661a.css",
"build/invoice.js": "build/invoice.19f36eca.js",
"build/invoice-pdf.css": "build/invoice-pdf.9a7468ef.css",