Fix ListRenderer _onWindowClicked to preserve default datepicker behavior - Final solution
This commit is contained in:
parent
eb2d2f3fd0
commit
8723a4c578
|
|
@ -151,15 +151,24 @@ odoo.define('web_hijri_datepicker.ListRenderer', function (require) {
|
|||
},
|
||||
|
||||
_onWindowClicked: function (event) {
|
||||
this._super.apply(this, arguments);
|
||||
|
||||
var $target = $(event.target);
|
||||
if ($target.hasClass('calendars-highlight') ||
|
||||
var isHijriElement = $target.hasClass('calendars-highlight') ||
|
||||
$target.closest('.calendars-popup').length ||
|
||||
$target.closest('.calendars').length ||
|
||||
$target.hasClass('o_hijri') ||
|
||||
$target.closest('.o_hijri').length) {
|
||||
return;
|
||||
$target.closest('.o_hijri').length;
|
||||
|
||||
if (!isHijriElement) {
|
||||
$('.o_hijri').each(function() {
|
||||
if ($(this).data && $(this).calendarsPicker) {
|
||||
try {
|
||||
$(this).calendarsPicker('hide');
|
||||
} catch (e) {}
|
||||
}
|
||||
});
|
||||
}
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue