query: more work on metrics tab changes

This commit is contained in:
Torkel Ödegaard
2017-05-20 10:48:47 +02:00
parent 912301fe24
commit b8aa6a8e47
4 changed files with 42 additions and 21 deletions

View File

@@ -1,9 +1,10 @@
define([
'angular',
'require',
'../core_module',
'app/core/utils/kbn',
],
function (angular, coreModule, kbn) {
function (angular, require, coreModule, kbn) {
'use strict';
coreModule.default.directive('tip', function($compile) {
@@ -18,6 +19,20 @@ function (angular, coreModule, kbn) {
};
});
coreModule.default.directive('clipboardButton',function() {
return function(scope, elem) {
require(['vendor/clipboard/dist/clipboard'], function(Clipboard) {
scope.clipboard = new Clipboard(elem[0]);
});
scope.$on('$destroy', function() {
if (scope.clipboard) {
scope.clipboard.destroy();
}
});
};
});
coreModule.default.directive('watchChange', function() {
return {
scope: { onchange: '&watchChange' },