datetime-picker.js: Show an icon inside the flatpickr input
This commit is contained in:
parent
5a6e3cf32f
commit
4236dd84d9
|
@ -9,6 +9,7 @@
|
|||
|
||||
try {
|
||||
var Flatpickr = require('icinga/ipl/vendor/flatpickr');
|
||||
var notjQuery = require('icinga/ipl/notjQuery');
|
||||
} catch (e) {
|
||||
console.warn('Unable to provide datetime picker. Libraries not available:', e);
|
||||
return;
|
||||
|
@ -102,6 +103,8 @@
|
|||
|
||||
var fp = Flatpickr(this, options);
|
||||
fp.calendarContainer.classList.add('icinga-datetime-picker');
|
||||
this.parentNode.insertBefore(_this.renderIcon(), fp.altInput.nextSibling);
|
||||
|
||||
_this._pickers.set(fp, containerId);
|
||||
});
|
||||
};
|
||||
|
@ -174,6 +177,10 @@
|
|||
}
|
||||
};
|
||||
|
||||
DatetimePicker.prototype.renderIcon = function () {
|
||||
return notjQuery.render('<i class="icon fa fa-calendar" role="image"></i>');
|
||||
};
|
||||
|
||||
Icinga.Behaviors.DatetimePicker = DatetimePicker;
|
||||
|
||||
})(Icinga, jQuery);
|
||||
|
|
Loading…
Reference in New Issue