parent
40473f9fbd
commit
adaeeba5d0
7 changed files with 129 additions and 43 deletions
|
@ -1162,16 +1162,16 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
$scope.patternMap = {};
|
||||
|
||||
$scope.getRegexp = function(pattern) {
|
||||
if (!pattern) {
|
||||
pattern = '.*';
|
||||
}
|
||||
if (!pattern) {
|
||||
pattern = '.*';
|
||||
}
|
||||
|
||||
if ($scope.patternMap[pattern]) {
|
||||
return $scope.patternMap[pattern];
|
||||
}
|
||||
if ($scope.patternMap[pattern]) {
|
||||
return $scope.patternMap[pattern];
|
||||
}
|
||||
|
||||
return $scope.patternMap[pattern] = new RegExp(pattern);
|
||||
};
|
||||
return $scope.patternMap[pattern] = new RegExp(pattern);
|
||||
};
|
||||
|
||||
$scope.$watch('binding', function(binding) {
|
||||
if (firstSet && !binding && $scope.defaultValue) {
|
||||
|
@ -1184,4 +1184,36 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
})
|
||||
|
||||
.directive('configStringListField', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/config/config-string-list-field.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'binding': '=binding',
|
||||
'itemTitle': '@itemTitle',
|
||||
'itemDelimiter': '@itemDelimiter',
|
||||
'placeholder': '@placeholder',
|
||||
'isOptional': '=isOptional'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
$scope.$watch('internalBinding', function(value) {
|
||||
if (value) {
|
||||
$scope.binding = value.split($scope.itemDelimiter);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('binding', function(value) {
|
||||
if (value) {
|
||||
$scope.internalBinding = value.join($scope.itemDelimiter);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
||||
|
||||
|
|
Reference in a new issue