From ac39ed421881ec9c8f8fa9fad217b17848d7f3ff Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 29 Mar 2017 11:16:16 +0200 Subject: [PATCH] panel: fixes #7970. Description tooltip overflow. This seems to work for the three use cases: - Overflow on the left - Overflow on the right - Elements that are out of view on page load --- public/app/features/panel/panel_directive.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 0482abc0437..5868bfcbf54 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -156,11 +156,21 @@ module.directive('grafanaPanel', function($rootScope, $document) { content: function() { return ctrl.getInfoContent({mode: 'tooltip'}); }, - position: 'top center', classes: ctrl.error ? 'drop-error' : 'drop-help', openOn: 'hover', hoverOpenDelay: 100, - constrainToScrollParent: false, + remove: true, + tetherOptions: { + attachment: 'bottom left', + targetAttachment: 'top left', + constraints: [ + { + to: 'window', + attachment: 'together', + pin: true + } + ], + } }); } } @@ -185,6 +195,10 @@ module.directive('grafanaPanel', function($rootScope, $document) { if (ctrl.skippedLastRefresh) { ctrl.refresh(); } + + if (infoDrop) { + infoDrop.position(); + } }; $document.on('scroll', refreshOnScroll);