mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
Conflicts: public/app/features/dashboard/dashboardCtrl.js public/app/partials/submenu.html public/css/less/submenu.less public/test/specs/templateSrv-specs.js src/app/partials/roweditor.html
41 lines
966 B
JavaScript
41 lines
966 B
JavaScript
define([
|
|
'angular',
|
|
'lodash'
|
|
],
|
|
function (angular, _) {
|
|
'use strict';
|
|
|
|
var module = angular.module('grafana.controllers');
|
|
|
|
module.controller('SubmenuCtrl', function($scope, $q, $rootScope, templateValuesSrv, dynamicDashboardSrv) {
|
|
var _d = {
|
|
enable: true
|
|
};
|
|
|
|
_.defaults($scope.pulldown,_d);
|
|
|
|
$scope.init = function() {
|
|
$scope.panel = $scope.pulldown;
|
|
$scope.row = $scope.pulldown;
|
|
$scope.variables = $scope.dashboard.templating.list;
|
|
$scope.annotations = $scope.dashboard.templating.list;
|
|
};
|
|
|
|
$scope.disableAnnotation = function (annotation) {
|
|
annotation.enable = !annotation.enable;
|
|
$rootScope.$broadcast('refresh');
|
|
};
|
|
|
|
$scope.variableUpdated = function(variable) {
|
|
templateValuesSrv.variableUpdated(variable).then(function() {
|
|
dynamicDashboardSrv.update($scope.dashboard);
|
|
$rootScope.$broadcast('refresh');
|
|
});
|
|
};
|
|
|
|
$scope.init();
|
|
|
|
});
|
|
|
|
});
|