Fix broken 3dots menu for nm in mobile theme

This commit is contained in:
hadi 2023-05-02 18:53:32 +02:00
parent 2770b66558
commit 2a18d8ec48
2 changed files with 7 additions and 7 deletions

View File

@ -301,6 +301,8 @@ export function egwPopupActionImplementation()
_callback(event); _callback(event);
} }
}); });
// bind a custom event tapandhold to be able to call it from nm action button
_node.addEventListener('tapandhold', _event=>{_callback(_)});
} }
/** /**
* Registers the handler for the context menu * Registers the handler for the context menu
@ -324,7 +326,7 @@ export function egwPopupActionImplementation()
{ {
_egw_active_menu.hide(); _egw_active_menu.hide();
} }
else if (!e.ctrlKey && e.which == 3 || e.which === 0) // tap event indicates by 0 else if (!e.ctrlKey && e.which == 3 || e.which === 0 || e.type === 'tapandhold') // tap event indicates by 0
{ {
var _xy = ai._getPageXY(e); var _xy = ai._getPageXY(e);
var _implContext = {event:e, posx:_xy.posx, posy: _xy.posy}; var _implContext = {event:e, posx:_xy.posx, posy: _xy.posy};

View File

@ -3440,12 +3440,10 @@ export class et2_nextmatch_header_bar extends et2_DOMWidget implements et2_INext
.hide() .hide()
.click(function(e) .click(function(e)
{ {
// @ts-ignore if (self.nextmatch.getDOMNode().getElementsByClassName('selected').length>0)
jQuery('tr.selected', self.nextmatch.getDOMNode()).trigger({ {
type: 'contextmenu', self.nextmatch.getDOMNode().getElementsByClassName('selected')[0].dispatchEvent(new CustomEvent("tapandhold",{type:'tapandhold'}));
which: 3, }
originalEvent: e
});
}) })
.prependTo(this.search_box); .prependTo(this.search_box);
} }