Revert "Merge branch '455-datepicker-interagieren-schlecht-mit-modals' into 'master'"

This reverts merge request !266
This commit is contained in:
Gregor Kleen 2019-09-12 14:24:16 +02:00
parent 91b249e58b
commit ab4d67eb37

View File

@ -3,7 +3,6 @@ import { Utility } from '../../core/utility';
import moment from 'moment';
const KEYCODE_ESCAPE = 27;
const Z_INDEX_MODAL = 9999;
// INTERNAL (Uni2work specific) formats for formatting dates and/or times
const FORM_DATE_FORMAT = {
@ -140,16 +139,6 @@ export class Datepicker {
// initialize tail.datetime (datepicker) instance
this.datepickerInstance = datetime(this._element, { ...datepickerGlobalConfig, ...datepickerConfig });
// append the datepicker element (dt) to the form
this._element.form.appendChild(this.datepickerInstance.dt);
// if the input element is in any open modal, increase the z-index of the datepicker and set its position to fixed to avoid repositioning on page scroll
// FIXME: instead of setting the position to fixed, use absolute and reposition (decrease left)
if (this._element.closest('.modal--open')) {
this.datepickerInstance.dt.style.zIndex = Z_INDEX_MODAL;
this.datepickerInstance.dt.style.position = 'fixed';
}
// register this datepicker instance with the formID of the given element in the datepicker collection
const formID = this._element.form.id;
const elemID = this._element.id;