Merge branch 'patch' into next

This commit is contained in:
JannisX11 2023-10-19 20:48:24 +02:00
commit fc9534c7d1
3 changed files with 8 additions and 2 deletions

View File

@ -62,6 +62,7 @@ class Menu {
this.onClose = this.options.onClose;
}
hover(node, event, expand) {
if (node.classList.contains('focused')) return;
if (event) event.stopPropagation()
$(open_menu.node).find('li.focused').removeClass('focused')
$(open_menu.node).find('li.opened').removeClass('opened')

View File

@ -510,8 +510,7 @@ new Property(ModelProject, 'array', 'timeline_setups', {
condition: () => Format.animation_mode,
});
new Property(ModelProject, 'object', 'unhandled_root_fields', {
exposed: false,
default: {}
exposed: false
});

View File

@ -19,6 +19,7 @@ class Property {
case 'number': this.default = 0; break;
case 'boolean': this.default = false; break;
case 'array': this.default = []; break;
case 'object': this.default = {}; break;
case 'instance': this.default = null; break;
case 'vector': this.default = [0, 0, 0]; break;
case 'vector2': this.default = [0, 0]; break;
@ -31,6 +32,7 @@ class Property {
case 'number': this.isNumber = true; break;
case 'boolean': this.isBoolean = true; break;
case 'array': this.isArray = true; break;
case 'object': this.isObject = true; break;
case 'instance': this.isInstance = true; break;
case 'vector': this.isVector = true; break;
case 'vector2': this.isVector2 = true; break;
@ -68,6 +70,10 @@ class Property {
getDefault(instance) {
if (typeof this.default == 'function') {
return this.default(instance);
} else if (this.isArray) {
return this.default.slice();
} else if (this.isObject) {
return Object.keys(this.default).length ? JSON.parse(JSON.stringify(this.default)) : {};
} else {
return this.default;
}