From 3435c475f58ad191683ba2d8b1dc8423fcae11bd Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 8 Sep 2022 16:16:34 +0200 Subject: [PATCH] Implement cursor position center for egw_tooltip --- api/js/jsapi/egw_tooltip.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/jsapi/egw_tooltip.js b/api/js/jsapi/egw_tooltip.js index 5a9b145703..3ad1a6722c 100644 --- a/api/js/jsapi/egw_tooltip.js +++ b/api/js/jsapi/egw_tooltip.js @@ -37,6 +37,7 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) var optionsDefault = { hideonhover: true, + position:'right', open: function(){}, close: function(){} }; @@ -66,7 +67,7 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) var cursor_rect = { left: (x - 8), top: (y - 8), - right: (x + 8), + right: (x + (options.position == "center" ? -1 * tooltip_div.width()/2 : 8)), bottom: (y + 8) };