diff --git a/public/app/directives/variableValueSelect.js b/public/app/directives/variableValueSelect.js index 41f8d5b1322..bdc914c144d 100644 --- a/public/app/directives/variableValueSelect.js +++ b/public/app/directives/variableValueSelect.js @@ -13,7 +13,7 @@ function (angular, app, _) { var vm = this; vm.show = function() { - vm.oldCurrentText = vm.variable.current.text; + vm.oldLinkText = vm.variable.current.text; vm.highlightIndex = -1; var currentValues = vm.variable.current.value; @@ -44,6 +44,9 @@ function (angular, app, _) { vm.updateLinkText = function() { vm.linkText = vm.variable.current.text; + if (vm.oldLinkText && vm.oldLinkText !== vm.linkText) { + vm.onUpdated(); + } }; vm.clearSelections = function() { diff --git a/public/app/features/dashboard/submenuCtrl.js b/public/app/features/dashboard/submenuCtrl.js index 6f423ebbe59..b8e609c061e 100644 --- a/public/app/features/dashboard/submenuCtrl.js +++ b/public/app/features/dashboard/submenuCtrl.js @@ -18,9 +18,7 @@ function (angular, _) { $scope.panel = $scope.pulldown; $scope.row = $scope.pulldown; $scope.annotations = $scope.dashboard.templating.list; - $scope.variables = _.map($scope.dashboard.templating.list, function(variable) { - return variable; - }); + $scope.variables = $scope.dashboard.templating.list; }; $scope.disableAnnotation = function (annotation) { @@ -28,8 +26,8 @@ function (angular, _) { $rootScope.$broadcast('refresh'); }; - $scope.getValuesForTag = function() { - return $q.when(['backend_01', 'backend_02']); + $scope.getValuesForTag = function(variable, tagKey) { + return templateValuesSrv.getValuesForTag(variable, tagKey); }; $scope.variableUpdated = function(variable) { diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index 99b50d45866..382790e0f21 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -228,25 +228,25 @@