Refactor Setting class to fix formatting and event handling

This commit is contained in:
Harvey Zack committed 2024-10-19 23:37:01 +08:00
1 parent e8c317051a
commit 49704ffc29
3 files changed
+7 -9

No files matched your search

+3 -4
View File
@@ -4599,9 +4599,7 @@ class Setting extends (0, _componentDefault.default) {
this.render();
}
});
art.on("resize", ()=>{
this.resize();
});
art.on("resize", ()=>this.resize());
}
}
get builtin() {
@@ -4673,7 +4671,8 @@ class Setting extends (0, _componentDefault.default) {
const target = this.find(setting.name);
if (target) {
Object.assign(target, setting);
this.reset();
this.format();
this.render();
} else this.add(setting);
}
add(setting) {