From 4a7f775a97879ca838b73b144f5db4919ac0e0ec Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 13 Sep 2023 14:05:50 -0600 Subject: [PATCH] Hide tooltips when context menu opens --- api/js/egw_action/EgwPopupActionImplementation.ts | 5 ++++- api/js/jsapi/egw_tooltip.js | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/api/js/egw_action/EgwPopupActionImplementation.ts b/api/js/egw_action/EgwPopupActionImplementation.ts index edb0d0904e..17e4e01c0e 100644 --- a/api/js/egw_action/EgwPopupActionImplementation.ts +++ b/api/js/egw_action/EgwPopupActionImplementation.ts @@ -11,12 +11,12 @@ import {_egw_active_menu, egwMenu, egwMenuItem} from "./egw_menu"; import {EGW_KEY_ENTER, EGW_KEY_MENU} from "./egw_action_constants"; import {tapAndSwipe} from "../tapandswipe"; -import {EgwAction} from "./EgwAction"; import {EgwFnct} from "./egw_action_common"; import "./egwGlobal" import {EgwActionImplementation} from "./EgwActionImplementation"; import {EgwActionObject} from "./EgwActionObject"; import {EgwPopupAction} from "./EgwPopupAction"; +import {egw} from "../jsapi/egw_global"; export class EgwPopupActionImplementation implements EgwActionImplementation { type = "popup"; @@ -243,6 +243,9 @@ export class EgwPopupActionImplementation implements EgwActionImplementation { e = window.event; } + // Close any open tooltip so they don't get in the way + egw(window).tooltipCancel(); + if (_egw_active_menu) { _egw_active_menu.hide(); } else if (!e.ctrlKey && e.which == 3 || e.which === 0 || e.type === 'tapandhold') // tap event indicates by 0 diff --git a/api/js/jsapi/egw_tooltip.js b/api/js/jsapi/egw_tooltip.js index 3ad1a6722c..ba6a599e0c 100644 --- a/api/js/jsapi/egw_tooltip.js +++ b/api/js/jsapi/egw_tooltip.js @@ -251,6 +251,15 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) tooltip_div.fadeOut(100); tooltip_div.remove(); } + }, + + /** + * Hide tooltip, cancel the timer + */ + tooltipCancel: function () + { + hide(); + current_elem = null; } };