From 09f252a7e13bab00b5d1ac1db874e8c4d4e5789f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 22 Apr 2016 13:55:47 -0400 Subject: [PATCH] Fix handling of default values in string config fields Fixes #1322 --- static/js/core-config-setup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js index 4ac8c3e5e..bd1fa7620 100644 --- a/static/js/core-config-setup.js +++ b/static/js/core-config-setup.js @@ -1045,6 +1045,8 @@ angular.module("core-config-setup", ['angularFileUpload']) 'isOptional': '=isOptional' }, controller: function($scope, $element) { + var firstSet = true; + $scope.getRegexp = function(pattern) { if (!pattern) { pattern = '.*'; @@ -1053,8 +1055,9 @@ angular.module("core-config-setup", ['angularFileUpload']) }; $scope.$watch('binding', function(binding) { - if (!binding && $scope.defaultValue) { + if (firstSet && !binding && $scope.defaultValue) { $scope.binding = $scope.defaultValue; + firstSet = false; } $scope.errorMessage = $scope.validator({'value': binding || ''});