Merge pull request #1404 from coreos-inc/setuptoolbugfix

Fix handling of default values in string config fields
This commit is contained in:
josephschorr 2016-04-22 14:21:16 -04:00
commit 6f6ec0e9c7

View file

@ -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 || ''});