import _ from 'lodash'; import $ from 'jquery'; import coreModule from 'app/core/core_module'; import alertDef from '../alerting/state/alertDef'; /** @ngInject */ export function annotationTooltipDirective($sanitize, dashboardSrv, contextSrv, $compile) { function sanitizeString(str) { try { return $sanitize(str); } catch (err) { console.log('Could not sanitize annotation string, html escaping instead'); return _.escape(str); } } return { restrict: 'E', scope: { event: '=', onEdit: '&', }, link: (scope, element) => { const event = scope.event; let title = event.title; let text = event.text; const dashboard = dashboardSrv.getCurrent(); let tooltip = '