working on U4-5875 - Updated RequiredManifestValueValidator to automatically check for empty json strings if the value type is JSON. Updates the TagsPropertyEditor to check for empty json in it's required validator. Updated the tags JS to always update the model value so if there's a server side validation, it gets cleared on change.

This commit is contained in:
Shannon
2015-01-05 14:25:16 +11:00
parent 459d9b34e7
commit d4c0ea9c48
3 changed files with 71 additions and 0 deletions

View File

@@ -34,6 +34,9 @@ angular.module("umbraco")
if (tagToAdd.length > 0) {
if ($scope.currentTags.indexOf(tagToAdd) < 0) {
$scope.currentTags.push(tagToAdd);
//update the model value, this is required if there's a server validation error, it can
// only then be cleared if the model changes
$scope.model.value = $scope.currentTags;
}
}
}
@@ -66,6 +69,9 @@ angular.module("umbraco")
var i = $scope.currentTags.indexOf(tag);
if (i >= 0) {
$scope.currentTags.splice(i, 1);
//update the model value, this is required if there's a server validation error, it can
// only then be cleared if the model changes
$scope.model.value = $scope.currentTags;
}
};