Fix Nested Content JS errors when enforcing min items (#7628)

This commit is contained in:
Kenn Jacobsen
2020-02-19 14:10:21 +01:00
committed by GitHub
parent 3d10a061e9
commit 64cffcb967

View File

@@ -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();
}