From 656a079c589cd2cab280263735a9d22464865113 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 21 Apr 2023 11:31:03 +0200 Subject: [PATCH] Expand build slot tree by 2 levels by default --- app/imports/client/ui/creature/buildTree/BuildTreeNode.vue | 7 ++++++- .../client/ui/creature/buildTree/BuildTreeNodeList.vue | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue b/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue index a61b0c3b..26629374 100644 --- a/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue +++ b/app/imports/client/ui/creature/buildTree/BuildTreeNode.vue @@ -93,6 +93,7 @@ v-if="showExpanded" :children="computedChildren" :parent-slot-id="computedSlotId" + :depth="depth" @selected="e => $emit('selected', e)" />
@@ -141,6 +142,10 @@ export default { context: { default: {} } }, props: { + depth: { + type: Number, + default: 0, + }, node: { type: Object, required: true, @@ -155,7 +160,7 @@ export default { }, }, data(){return { - expanded: false, + expanded: this.depth <= 2, /* expand if there's a slot needing attention: this.node._descendantCanFill || ( this.node.type === 'propertySlot' && diff --git a/app/imports/client/ui/creature/buildTree/BuildTreeNodeList.vue b/app/imports/client/ui/creature/buildTree/BuildTreeNodeList.vue index 9a8aa35b..497ced9e 100644 --- a/app/imports/client/ui/creature/buildTree/BuildTreeNodeList.vue +++ b/app/imports/client/ui/creature/buildTree/BuildTreeNodeList.vue @@ -6,6 +6,7 @@ :node="child.node" :children="child.children" :parent-slot-id="parentSlotId" + :depth="depth + 1" @selected="e => $emit('selected', e)" />
@@ -27,6 +28,10 @@ export default { type: String, default: undefined, }, + depth: { + type: Number, + default: 0, + }, }, data() { return {