Fixed build tree
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
/>
|
/>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="doc.parent.id === parentSlotId"
|
v-if="doc.parentId === parentSlotId"
|
||||||
icon
|
icon
|
||||||
:disabled="context.editPermission === false"
|
:disabled="context.editPermission === false"
|
||||||
@click.stop="remove(doc)"
|
@click.stop="remove(doc)"
|
||||||
|
|||||||
@@ -346,20 +346,16 @@ export default {
|
|||||||
],
|
],
|
||||||
removed: {$ne: true},
|
removed: {$ne: true},
|
||||||
inactive: {$ne: true},
|
inactive: {$ne: true},
|
||||||
}, {
|
|
||||||
sort: {order: 1}
|
|
||||||
});
|
});
|
||||||
const slotIds = slots.map(s => s._id);
|
const slotIds = slots.map(s => s._id);
|
||||||
const slotChildren = CreatureProperties.find({
|
const slotChildren = CreatureProperties.find({
|
||||||
'parent.id': {$in: slotIds},
|
'parentId': {$in: slotIds},
|
||||||
removed: {$ne: true},
|
removed: {$ne: true},
|
||||||
}, {
|
|
||||||
sort: { order: 1 },
|
|
||||||
});
|
});
|
||||||
const tree = docsToForest([
|
const tree = docsToForest([
|
||||||
...slots.fetch(),
|
...slots.fetch(),
|
||||||
...slotChildren.fetch()
|
...slotChildren.fetch()
|
||||||
]);
|
].sort((a, b) => a.left - b.left));
|
||||||
traverse(tree, (child, parents) => {
|
traverse(tree, (child, parents) => {
|
||||||
const model = child.doc;
|
const model = child.doc;
|
||||||
const isSlotWithSpace = model.type === 'propertySlot' && (
|
const isSlotWithSpace = model.type === 'propertySlot' && (
|
||||||
|
|||||||
Reference in New Issue
Block a user