Commit 59513ff9 by Daniel Lee

tempvar: bug fix for duplicate template var

and a fix for when selecting the same value twice in
a template variable if it is not multi select. It threw an
exception on the second selection
parent 668cb3c1
...@@ -122,7 +122,7 @@ function (angular, _, coreModule) { ...@@ -122,7 +122,7 @@ function (angular, _, coreModule) {
vm.selectValue = function(option, event, commitChange, excludeOthers) { vm.selectValue = function(option, event, commitChange, excludeOthers) {
if (!option) { return; } if (!option) { return; }
option.selected = !option.selected; option.selected = vm.variable.multi ? !option.selected: true;
commitChange = commitChange || false; commitChange = commitChange || false;
excludeOthers = excludeOthers || false; excludeOthers = excludeOthers || false;
......
...@@ -106,7 +106,7 @@ export class VariableEditorCtrl { ...@@ -106,7 +106,7 @@ export class VariableEditorCtrl {
var clone = _.cloneDeep(variable.getSaveModel()); var clone = _.cloneDeep(variable.getSaveModel());
$scope.current = variableSrv.createVariableFromModel(clone); $scope.current = variableSrv.createVariableFromModel(clone);
$scope.current.name = 'copy_of_'+variable.name; $scope.current.name = 'copy_of_'+variable.name;
$scope.variableSrv.addVariable($scope.current); variableSrv.addVariable($scope.current);
}; };
$scope.update = function() { $scope.update = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment