tip.js 494 B

1234567891011121314151617181920
  1. define([
  2. 'angular',
  3. 'kbn'
  4. ],
  5. function (angular, kbn) {
  6. 'use strict';
  7. angular
  8. .module('grafana.directives')
  9. .directive('tip', function($compile) {
  10. return {
  11. restrict: 'E',
  12. link: function(scope, elem, attrs) {
  13. var _t = '<i class="grafana-tip icon-'+(attrs.icon||'question-sign')+'" bs-tooltip="\''+
  14. kbn.addslashes(elem.text())+'\'"></i>';
  15. elem.replaceWith($compile(angular.element(_t))(scope));
  16. }
  17. };
  18. });
  19. });