mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 00:16:51 +00:00
Fix bug breaking collapsible objects
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" data-name></span>
|
||||
</div>
|
||||
<select class="form-control entry-type" onchange="updateField(this)">
|
||||
<select class="form-control" onchange="updateField(this)">
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mt-3" data-type="random">
|
||||
|
||||
11
model.js
11
model.js
@@ -227,12 +227,13 @@ function removeFromSet(el, array) {
|
||||
}
|
||||
|
||||
function toggleCollapseObject(el) {
|
||||
let parent = getSuperParent(el);
|
||||
let field = $(el).closest('[data-field]').attr('data-field');
|
||||
if (!parent[field]) {
|
||||
parent[field] = {};
|
||||
let path = getPath(el);
|
||||
let index = path.pop();
|
||||
let node = getNode(path);
|
||||
if (!node[index]) {
|
||||
node[index] = {};
|
||||
} else {
|
||||
delete parent[field];
|
||||
delete node[index];
|
||||
}
|
||||
invalidated();
|
||||
}
|
||||
|
||||
@@ -81,6 +81,11 @@
|
||||
"minecraft:dynamic"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "quality",
|
||||
"type": "random",
|
||||
"luck_based": true
|
||||
},
|
||||
{
|
||||
"id": "children",
|
||||
"type": "array",
|
||||
|
||||
Reference in New Issue
Block a user