Sort block list and nested content within parent container

This commit is contained in:
Bjarne Fyrstenborg
2020-08-21 00:19:50 +02:00
committed by Sebastiaan Janssen
parent 61e96781da
commit 841fd2679f
2 changed files with 6 additions and 5 deletions

View File

@@ -165,9 +165,7 @@
icon: 'trash',
method: removeAllEntries,
isDisabled: true
}
};
// helper to force the current form into the dirty state
function setDirty() {
@@ -301,7 +299,7 @@
return (vm.nodes.length > vm.minItems)
? true
: model.config.contentTypes.length > 1;
}
};
function deleteNode(idx) {
var removed = vm.nodes.splice(idx, 1);
@@ -316,6 +314,7 @@
updateModel();
validate();
};
vm.requestDeleteNode = function (idx) {
if (!vm.canDeleteNode(idx)) {
return;
@@ -403,10 +402,11 @@
var scaffold = getScaffold(model.value[idx].ncContentTypeAlias);
return scaffold && scaffold.icon ? iconHelper.convertFromLegacyIcon(scaffold.icon) : "icon-folder";
}
};
vm.sortableOptions = {
axis: "y",
containment: "parent",
cursor: "move",
handle: '.umb-nested-content__header-bar',
distance: 10,