Files
grafana/src/app/features/dashboard/submenuCtrl.js

40 lines
891 B
JavaScript
Raw Normal View History

2014-02-09 19:31:06 +01:00
define([
'angular',
2014-08-07 14:35:19 +02:00
'lodash'
2014-02-09 19:31:06 +01:00
],
2014-09-24 17:15:58 +02:00
function (angular, _) {
2014-02-09 19:31:06 +01:00
'use strict';
2014-07-28 18:11:52 +02:00
var module = angular.module('grafana.controllers');
2014-02-09 19:31:06 +01:00
module.controller('SubmenuCtrl', function($scope, $q, $rootScope, templateValuesSrv) {
2014-06-07 06:38:33 +02:00
var _d = {
enable: true
};
2014-02-09 19:31:06 +01:00
2014-06-07 06:38:33 +02:00
_.defaults($scope.pulldown,_d);
2014-02-09 19:31:06 +01:00
2014-06-07 06:38:33 +02:00
$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');
};
2015-03-19 23:09:50 -04:00
$scope.variableUpdated = function(variable) {
templateValuesSrv.variableUpdated(variable).then(function() {
$rootScope.$broadcast('refresh');
});
};
2014-06-07 06:38:33 +02:00
$scope.init();
2014-02-09 19:31:06 +01:00
2014-06-07 06:38:33 +02:00
});
2014-02-09 19:31:06 +01:00
});