Commit de396b27 by Marcus Efraimsson Committed by GitHub

Merge pull request #11309 from grafana/add_graphite_func_js_to_ts

convert add_graphite_func.js to typescript
parents 4dcf1b72 3bdd0062
define(['angular', 'lodash', 'jquery', 'rst2html', 'tether-drop'], function(angular, _, $, rst2html, Drop) {
'use strict';
angular.module('grafana.directives').directive('graphiteAddFunc', function($compile) {
var inputTemplate =
import angular from 'angular';
import _ from 'lodash';
import $ from 'jquery';
import rst2html from 'rst2html';
import Drop from 'tether-drop';
export function graphiteAddFunc($compile) {
const inputTemplate =
'<input type="text"' + ' class="gf-form-input"' + ' spellcheck="false" style="display:none"></input>';
var buttonTemplate =
const buttonTemplate =
'<a class="gf-form-label query-part dropdown-toggle"' +
' tabindex="1" gf-dropdown="functionMenu" data-toggle="dropdown">' +
'<i class="fa fa-plus"></i></a>';
......@@ -40,7 +43,7 @@ define(['angular', 'lodash', 'jquery', 'rst2html', 'tether-drop'], function(angu
});
if (!funcDef) {
return;
return '';
}
}
......@@ -124,9 +127,11 @@ define(['angular', 'lodash', 'jquery', 'rst2html', 'tether-drop'], function(angu
$scope.$on('$destroy', cleanUpDrop);
},
};
});
}
angular.module('grafana.directives').directive('graphiteAddFunc', graphiteAddFunc);
function createFunctionDropDownMenu(funcDefs) {
function createFunctionDropDownMenu(funcDefs) {
var categories = {};
_.forEach(funcDefs, function(funcDef) {
......@@ -151,5 +156,4 @@ define(['angular', 'lodash', 'jquery', 'rst2html', 'tether-drop'], function(angu
}),
'text'
);
}
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment