From 604f8a22f732b0b29aec1576f9ed5ebded01ab47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 9 Jun 2015 10:22:43 +0200 Subject: [PATCH] Fixed state issue with variable value dropdown, #2080 --- public/app/directives/valueSelectDropdown.js | 2 +- public/test/specs/valueSelectDropdown-specs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/directives/valueSelectDropdown.js b/public/app/directives/valueSelectDropdown.js index 14791eba0f3..f1763514f25 100644 --- a/public/app/directives/valueSelectDropdown.js +++ b/public/app/directives/valueSelectDropdown.js @@ -34,7 +34,7 @@ function (angular, app, _) { var tag = { text: value, selected: false }; _.each(vm.variable.current.tags, function(tagObj) { if (tagObj.text === value) { - tag.selected = true; + tag = tagObj; } }); return tag; diff --git a/public/test/specs/valueSelectDropdown-specs.js b/public/test/specs/valueSelectDropdown-specs.js index 9fadb893467..f329e3f6738 100644 --- a/public/test/specs/valueSelectDropdown-specs.js +++ b/public/test/specs/valueSelectDropdown-specs.js @@ -138,7 +138,7 @@ function () { describe("Given variable with selected tags", function() { beforeEach(function() { ctrl.variable = { - current: {text: 'server-1', value: 'server-1', tags: [{text: 'key1'}] }, + current: {text: 'server-1', value: 'server-1', tags: [{text: 'key1', selected: true}] }, options: [ {text: 'server-1', value: 'server-1'}, {text: 'server-2', value: 'server-2'},