define([ 'angular', 'lodash' ], function (angular) { 'use strict'; angular .module('grafana.directives') .directive('annotationTooltip', function($sanitize, dashboardSrv) { return { scope: { tagColorFromName: "=" }, link: function (scope, element) { var title = $sanitize(scope.annoation.title); var dashboard = dashboardSrv.getCurrent(); var time = '' + dashboard.formatDate(scope.annotation.time) + ''; var tooltip = '
'+ title + ' ' + time + '
' ; if (options.tags) { var tags = $sanitize(options.tags); tooltip += '' + (tags || '') + '
'; } if (options.text) { var text = $sanitize(options.text); tooltip += text.replace(/\n/g, '
'); } tooltip += ""; } }; }); });