mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
update setting
This commit is contained in:
1 parent
5bd2de4179
commit
018b556d6b
6 files changed
+102
-82
No files matched your search
@@ -7,6 +7,14 @@ export default function playbackRate(art) {
|
||||
return value === 1.0 ? i18n.get('Normal') : value;
|
||||
}
|
||||
|
||||
function update($panel, item, value) {
|
||||
item.$desc.innerText = getI18n(value);
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => Number(item.dataset.value) === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
html: i18n.get('Play Speed'),
|
||||
@@ -23,18 +31,9 @@ export default function playbackRate(art) {
|
||||
art.playbackRate = item.value;
|
||||
},
|
||||
mounted: ($panel, item) => {
|
||||
item.$desc.innerText = getI18n(art.playbackRate);
|
||||
|
||||
art.on('playbackRate', (value) => {
|
||||
item.$desc.innerText = getI18n(art.playbackRate);
|
||||
|
||||
const $current = queryAll('.art-setting-item', $panel).find(
|
||||
(item) => Number(item.dataset.value) === value,
|
||||
);
|
||||
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
update($panel, item, art.playbackRate);
|
||||
art.on('playbackRate', () => {
|
||||
update($panel, item, art.playbackRate);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user