[FIX] web_editor: prevent overlay-disable when clicking on a datepicker

When clicking inside a datetimepicker but not on a control element,
the datetimepicker was left opened while the left panel options
disappeared.
This commit is contained in:
qsm-odoo
2019-12-13 17:18:13 +00:00
parent 1f33c87c25
commit c415f08f89
@@ -1049,8 +1049,18 @@ const DatetimePickerUserValueWidget = InputUserValueWidget.extend({
widgetParent: 'body',
};
this.__libInput++;
$(this.inputEl).datetimepicker(datepickersOptions);
const $input = $(this.inputEl);
$input.datetimepicker(datepickersOptions);
this.__libInput--;
// Monkey-patch the library option to add custom classes on the pickers
const libObject = $input.data('datetimepicker');
const oldFunc = libObject._getTemplate;
libObject._getTemplate = function () {
const $template = oldFunc.call(this, ...arguments);
$template.addClass('o_we_no_overlay o_we_datetimepicker');
return $template;
};
},
//--------------------------------------------------------------------------