mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-24 12:35:05 +00:00
fix config item childrens order being wrong
This commit is contained in:
parent
675ff2d94d
commit
83b2801a36
1 changed files with 3 additions and 3 deletions
|
|
@ -194,8 +194,8 @@ export default class ConfigMenu {
|
||||||
.join("\n");
|
.join("\n");
|
||||||
options._onChange = options.onChange;
|
options._onChange = options.onChange;
|
||||||
options.onChange = (val) => {
|
options.onChange = (val) => {
|
||||||
const isValid = validate(val);
|
const isValid = validate(val) === true;
|
||||||
$(`.dribbblish-config-item[key="${options.key}"]`).attr("changed", isValid === true && val != options.defaultValue ? "" : null);
|
$(`.dribbblish-config-item[key="${options.key}"]`).attr("changed", options.type != "button" && isValid && val != options.defaultValue ? "" : null);
|
||||||
if (!isValid) return;
|
if (!isValid) return;
|
||||||
this.set(options.key, val, options.save);
|
this.set(options.key, val, options.save);
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ export default class ConfigMenu {
|
||||||
options.children.forEach((child) => this.#setHidden(child.key, Array.isArray(show) ? !show.includes(child.key) : !show));
|
options.children.forEach((child) => this.#setHidden(child.key, Array.isArray(show) ? !show.includes(child.key) : !show));
|
||||||
};
|
};
|
||||||
options.children = options.children.map((child) => {
|
options.children = options.children.map((child) => {
|
||||||
return { ...child, area: options.area, childOf: options.key };
|
return { ...child, area: options.area, childOf: options.key, order: options.order ?? 0 + child.order ?? 0 };
|
||||||
});
|
});
|
||||||
|
|
||||||
this.#config[options.key] = options;
|
this.#config[options.key] = options;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue