Fix topmenu dropdowns click handler

This commit is contained in:
Hadi Nategh 2022-09-26 13:36:10 +02:00
parent a09d833a07
commit 2ed1a12617
2 changed files with 25 additions and 4 deletions

View File

@ -158,11 +158,25 @@ egw.extend('timer', egw.MODULE_GLOBAL, function()
if (select.value) timerAction(select.value);
select.value = '';
});
select.addEventListener('sl-hide', (e) => {
if (e.currentTarget.nodeName === 'ET2-SELECT')
{
e.stopImmediatePropagation();
}
});
// bind click handler
timer_container.addEventListener('click', (ev) =>
{
select.dropdown.open = !select.dropdown.open ? true : false;
ev.stopPropagation();
ev.stopImmediatePropagation();
if (select.dropdown.open)
{
select.dropdown.hide();
}
else
{
select.dropdown.show();
}
});
// need to load timesheet translations for app-names
this.langRequire(window, [{app: 'timesheet', lang: this.preference('lang')}], () =>

View File

@ -18,8 +18,15 @@ egw_ready.then(function()
click: function(ev){
// do NOT react on bubbeling events from contained selectbox
var select = document.getElementById('quick_add_selectbox');
select.dropdown.open = !select.dropdown.open ? true : false;
ev.stopPropagation();
ev.stopImmediatePropagation();
if (select.dropdown.open)
{
select.dropdown.hide();
}
else
{
select.dropdown.show();
}
}
});