Fix handling of default values in string config fields

Fixes #1322
This commit is contained in:
Joseph Schorr 2016-04-22 13:55:47 -04:00
parent 460ccf2dfd
commit 09f252a7e1

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