Fix Nested Content JS errors when enforcing min items (#7628)
This commit is contained in:
@@ -480,10 +480,12 @@
|
||||
}
|
||||
|
||||
// Enforce min items if we only have one scaffold type
|
||||
var modelWasChanged = false;
|
||||
if (vm.nodes.length < vm.minItems && vm.scaffolds.length === 1) {
|
||||
for (var i = vm.nodes.length; i < model.config.minItems; i++) {
|
||||
addNode(vm.scaffolds[0].contentTypeAlias);
|
||||
}
|
||||
modelWasChanged = true;
|
||||
}
|
||||
|
||||
// If there is only one item, set it as current node
|
||||
@@ -495,6 +497,10 @@
|
||||
|
||||
vm.inited = true;
|
||||
|
||||
if (modelWasChanged) {
|
||||
updateModel();
|
||||
}
|
||||
|
||||
updatePropertyActionStates();
|
||||
checkAbilityToPasteContent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user