datetime-picker.js: Support input groups

This commit is contained in:
Johannes Meyer 2021-12-10 13:32:00 +01:00
parent e2a51e75e5
commit e01ee2d21e
1 changed files with 10 additions and 2 deletions

View File

@ -113,9 +113,17 @@
} }
} }
var fp = Flatpickr(this, options); var element = this;
if (!! options.wrap) {
element = this.parentNode;
}
var fp = Flatpickr(element, options);
fp.calendarContainer.classList.add('icinga-datetime-picker'); fp.calendarContainer.classList.add('icinga-datetime-picker');
this.parentNode.insertBefore(_this.renderIcon(), fp.altInput.nextSibling);
if (! !!options.wrap) {
this.parentNode.insertBefore(_this.renderIcon(), fp.altInput.nextSibling);
}
_this._pickers.set(fp, containerId); _this._pickers.set(fp, containerId);
}); });