From 5bc74522c5fb819c5741828375e32da3d0e586a3 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 12 May 2021 13:13:49 -0600 Subject: [PATCH] Api: Fix context menu button did not open context menu --- api/js/egw_action/egw_action_popup.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/js/egw_action/egw_action_popup.js b/api/js/egw_action/egw_action_popup.js index 7e85646f9f..cb1c0f4fbc 100644 --- a/api/js/egw_action/egw_action_popup.js +++ b/api/js/egw_action/egw_action_popup.js @@ -755,9 +755,13 @@ function egwPopupActionImplementation() },true); clipboard_action.group = 2.5; } - var os_clipboard_caption = this._context.event.originalEvent.target.innerText.trim(); - clipboard_action.set_caption(egw.lang('Copy "%1"', os_clipboard_caption.length>20 ? os_clipboard_caption.substring(0,20)+'...':os_clipboard_caption)); - clipboard_action.data.target = this._context.event.originalEvent.target; + let os_clipboard_caption = ""; + if(this._context.event) + { + os_clipboard_caption = this._context.event.originalEvent.target.innerText.trim(); + clipboard_action.set_caption(egw.lang('Copy "%1"', os_clipboard_caption.length > 20 ? os_clipboard_caption.substring(0, 20) + '...' : os_clipboard_caption)); + clipboard_action.data.target = this._context.event.originalEvent.target; + } jQuery(clipboard_action.data.target).off('copy').on('copy', function(event) { // Cancel any no-select css var target = jQuery(clipboard_action.data.target);