2016-01-24 15:39:25 -06:00
|
|
|
///<reference path="../../headers/common.d.ts" />
|
|
|
|
|
|
|
|
import angular from 'angular';
|
|
|
|
import config from 'app/core/config';
|
|
|
|
|
|
|
|
var directiveModule = angular.module('grafana.directives');
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
|
|
function panelEditorTab(dynamicDirectiveSrv) {
|
|
|
|
return dynamicDirectiveSrv.create({
|
|
|
|
scope: {
|
2016-01-25 14:09:37 -06:00
|
|
|
ctrl: "=",
|
2016-01-24 15:39:25 -06:00
|
|
|
editorTab: "=",
|
2016-01-26 16:28:07 -06:00
|
|
|
index: "=",
|
2016-01-24 15:39:25 -06:00
|
|
|
},
|
|
|
|
directive: scope => {
|
2016-01-26 16:28:07 -06:00
|
|
|
var pluginId = scope.ctrl.pluginId;
|
|
|
|
var tabIndex = scope.index;
|
|
|
|
|
2016-01-24 15:39:25 -06:00
|
|
|
return Promise.resolve({
|
2016-01-26 16:28:07 -06:00
|
|
|
name: `panel-editor-tab-${pluginId}${tabIndex}`,
|
2016-01-24 15:39:25 -06:00
|
|
|
fn: scope.editorTab.directiveFn,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
directiveModule.directive('panelEditorTab', panelEditorTab);
|