From 8e8c664e951028934ff520459e50d8f996b75046 Mon Sep 17 00:00:00 2001 From: hadi Date: Tue, 2 May 2023 18:53:32 +0200 Subject: [PATCH] Fix broken 3dots menu for nm in mobile theme --- api/js/egw_action/egw_action_popup.js | 4 +++- api/js/etemplate/et2_extension_nextmatch.ts | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/js/egw_action/egw_action_popup.js b/api/js/egw_action/egw_action_popup.js index 29950e5de7..c490e8be31 100644 --- a/api/js/egw_action/egw_action_popup.js +++ b/api/js/egw_action/egw_action_popup.js @@ -301,6 +301,8 @@ export function egwPopupActionImplementation() _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 @@ -324,7 +326,7 @@ export function egwPopupActionImplementation() { _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 _implContext = {event:e, posx:_xy.posx, posy: _xy.posy}; diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 6d555b359d..6823ca8ba0 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -3440,12 +3440,10 @@ export class et2_nextmatch_header_bar extends et2_DOMWidget implements et2_INext .hide() .click(function(e) { - // @ts-ignore - jQuery('tr.selected', self.nextmatch.getDOMNode()).trigger({ - type: 'contextmenu', - which: 3, - originalEvent: e - }); + if (self.nextmatch.getDOMNode().getElementsByClassName('selected').length>0) + { + self.nextmatch.getDOMNode().getElementsByClassName('selected')[0].dispatchEvent(new CustomEvent("tapandhold",{type:'tapandhold'})); + } }) .prependTo(this.search_box); }