update setting

This commit is contained in:
zhw2590582 committed 2022-02-11 20:23:27 +08:00
1 parent 81ba45adf9
commit 1de2d2aaed
12 files changed
+177 -153

No files matched your search

+6 -5
View File
@@ -9,8 +9,8 @@ export default function flip(art) {
vertical: 'Vertical',
};
function update($panel, $desc, value) {
if ($desc) $desc.innerText = i18n.get(keys[value]);
function update($panel, $description, value) {
if ($description) $description.innerText = i18n.get(keys[value]);
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
if ($current) inverseClass($current, 'art-current');
}
@@ -18,7 +18,7 @@ export default function flip(art) {
return {
width: 200,
html: i18n.get('Video Flip'),
desc: i18n.get(keys[art.flip]),
description: i18n.get(keys[art.flip]),
icon: icons.config,
selector: Object.keys(keys).map((item) => {
return {
@@ -29,11 +29,12 @@ export default function flip(art) {
}),
onSelect(item) {
art.flip = item.value;
return i18n.get(keys[item.value]);
},
mounted: ($panel, item) => {
update($panel, item.$desc, art.flip);
update($panel, item._$description, art.flip);
art.on('flip', () => {
update($panel, item.$desc, art.flip);
update($panel, item._$description, art.flip);
});
},
};