Merge pull request #5343 from kjac/v8-fix-mntp-bounds-validation
V8: Fix the MNTP min/max items validation
This commit is contained in:
@@ -33,7 +33,6 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
|
||||
/** Performs validation based on the renderModel data */
|
||||
function validate() {
|
||||
if ($scope.contentPickerForm) {
|
||||
angularHelper.getCurrentForm($scope).$setDirty();
|
||||
//Validate!
|
||||
if ($scope.model.config && $scope.model.config.minNumber && parseInt($scope.model.config.minNumber) > $scope.renderModel.length) {
|
||||
$scope.contentPickerForm.minCount.$setValidity("minCount", false);
|
||||
@@ -65,7 +64,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
|
||||
//model if it changes (i.e. based on server updates, or if used in split view, etc...)
|
||||
$scope.$watch("model.value", function (newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
syncRenderModel();
|
||||
syncRenderModel(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -379,7 +378,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
|
||||
}
|
||||
else {
|
||||
$scope.renderModel = [];
|
||||
if (validate) {
|
||||
if (doValidation) {
|
||||
validate();
|
||||
}
|
||||
setSortingState($scope.renderModel);
|
||||
@@ -459,6 +458,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
|
||||
//everything is loaded, start the watch on the model
|
||||
startWatch();
|
||||
subscribe();
|
||||
validate();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user