import _ from "lodash"; import $ from "jquery"; import coreModule from "app/core/core_module"; import alertDef from "../alerting/alert_def"; /** @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: function(scope, element) { var event = scope.event; var title = event.title; var text = event.text; var dashboard = dashboardSrv.getCurrent(); var tooltip = '