feat(datepicker): add option to change the position of the datepicker
This commit is contained in:
parent
863971fbde
commit
85f46ef230
@ -75,6 +75,12 @@ export class Datepicker {
|
|||||||
const datepickerGlobalConfig = DATEPICKER_CONFIG['global'];
|
const datepickerGlobalConfig = DATEPICKER_CONFIG['global'];
|
||||||
const datepickerConfig = DATEPICKER_CONFIG[this._element.getAttribute('type')];
|
const datepickerConfig = DATEPICKER_CONFIG[this._element.getAttribute('type')];
|
||||||
|
|
||||||
|
// additional position config (optional data-datepicker-position attribute in html) that can specialize the global config
|
||||||
|
const datepickerPosition = this._element.dataSet.datepickerPosition;
|
||||||
|
if (datepickerPosition) {
|
||||||
|
datepickerGlobalConfig.position = datepickerPosition;
|
||||||
|
}
|
||||||
|
|
||||||
if (!datepickerConfig) {
|
if (!datepickerConfig) {
|
||||||
throw new Error('Datepicker utility called on unsupported element!');
|
throw new Error('Datepicker utility called on unsupported element!');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user