diff --git a/public/app/core/components/info_popover.ts b/public/app/core/components/info_popover.ts index 98bbde1e683..cc49ecbc4ab 100644 --- a/public/app/core/components/info_popover.ts +++ b/public/app/core/components/info_popover.ts @@ -18,7 +18,7 @@ export function infoPopover() { var offset = attrs.offset || '0 -10px'; var position = attrs.position || 'right middle'; - var classes = 'drop-help'; + var classes = 'drop-help drop-hide-out-of-bounds'; if (attrs.wide) { classes += ' drop-wide'; } diff --git a/public/app/core/components/switch.ts b/public/app/core/components/switch.ts index c2ac6ca1497..e0971c02f9b 100644 --- a/public/app/core/components/switch.ts +++ b/public/app/core/components/switch.ts @@ -4,6 +4,7 @@ import config from 'app/core/config'; import _ from 'lodash'; import $ from 'jquery'; import coreModule from 'app/core/core_module'; +import Drop from 'tether-drop'; var template = ` @@ -44,10 +45,27 @@ export function switchDirective() { checked: "=", label: "@", labelClass: "@", + tooltip: "@", switchClass: "@", onChange: "&", }, template: template, + link: (scope, elem) => { + if (scope.ctrl.tooltip) { + var drop = new Drop({ + target: elem[0], + content: scope.ctrl.tooltip, + position: "right middle", + classes: 'drop-help', + openOn: 'hover', + hoverOpenDelay: 400, + }); + + scope.$on('$destroy', function() { + drop.destroy(); + }); + } + } }; } diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index 3ab3a582e49..33b1a247235 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -19,10 +19,11 @@
Default data source is preselected in new
- panels.
- Default data source is preselected in new
+ panels.
+