Skip to content

Commit

Permalink
更新代码
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxHuang committed Jul 11, 2023
1 parent ccf79f8 commit 15b3818
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions editor/inspector/contributions/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1156,12 +1156,8 @@ const Elements = {
$active.invalid = false;
}

if (dump.value.enabled.originVisible !== undefined) {
if (dump.value.enabled.originVisible) {
$active.removeAttribute('hidden');
} else {
$active.setAttribute('hidden', '');
}
if (dump.value.enabled.originVisible === false) {
$active.setAttribute('hidden', '');
}

const url = panel.getHelpUrl(dump.editor);
Expand Down Expand Up @@ -1210,30 +1206,30 @@ const Elements = {
$section.__type__ = component.type;

const $active = $section.querySelector('ui-checkbox');
if (component.value.enabled.originVisible) {
$active.value = component.value.enabled.value;
$active.dump = component.value.enabled;
$active.removeAttribute('hidden');
$active.addEventListener('change', (event) => {
event.stopPropagation();
$active.value = component.value.enabled.value;
$active.dump = component.value.enabled;
$active.removeAttribute('hidden');
$active.addEventListener('change', (event) => {
event.stopPropagation();

const value = !!$active.value;
const dump = $active.dump;
const value = !!$active.value;
const dump = $active.dump;

dump.value = value;
dump.value = value;

if ('values' in dump) {
dump.values.forEach((val, index) => {
dump.values[index] = value;
});
}
$active.dispatch('change-dump');
});
$active.addEventListener('confirm', (event) => {
event.stopPropagation();
$active.dispatch('confirm-dump');
});
} else {
if ('values' in dump) {
dump.values.forEach((val, index) => {
dump.values[index] = value;
});
}
$active.dispatch('change-dump');
});
$active.addEventListener('confirm', (event) => {
event.stopPropagation();
$active.dispatch('confirm-dump');
});

if (component.value.enabled.originVisible === false) {
$active.setAttribute('hidden', '');
}

Expand Down

0 comments on commit 15b3818

Please sign in to comment.