diff --git a/api/js/jsapi/egw_tooltip.js b/api/js/jsapi/egw_tooltip.js index ba7ecb04fc..b0ed2f6070 100644 --- a/api/js/jsapi/egw_tooltip.js +++ b/api/js/jsapi/egw_tooltip.js @@ -86,13 +86,16 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) tooltip_div.css('max-width', space_left.right); } - if (space_left.bottom < tooltip_height) { + // tooltip does fit neither above nor below: put him vertical centered left or right of cursor + if (space_left.bottom < tooltip_height && space_left.top < tooltip_height) { + if (tooltip_height > window_height-20) { + tooltip_div.css('max-height', tooltip_height=window_height-20); + } + tooltip_div.css('top', (window_height-tooltip_height)/2); + } else if (space_left.bottom < tooltip_height) { tooltip_div.css('top', cursor_rect.top - tooltip_height); - } else if (space_left.top >= tooltip_height) { + } else { tooltip_div.css('top', cursor_rect.bottom); - } else { - tooltip_div.css('top', cursor_rect.bottom); - tooltip_div.css('max-height', space_left.bottom); } tooltip_div.fadeIn(100); diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index 2101ccb301..dfc7a80557 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -869,6 +869,7 @@ ul.et2_link_string { -webkit-box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.75); -moz-box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.75); box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.75); + white-space: pre-wrap; } /** * Tabs widget