0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-04-15 01:38:44 +00:00

fix datepicker appears out of screen ()

This commit is contained in:
Kevin Papst 2021-06-10 15:51:26 +02:00 committed by GitHub
parent 7f20cb045c
commit 0b519e9d08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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",