Replace switch in controls.createProgress with object literal
This commit is contained in:
parent
2a186e425b
commit
99c10aa1fc
17
src/js/controls.js
vendored
17
src/js/controls.js
vendored
@ -331,19 +331,12 @@ const controls = {
|
||||
if (type !== 'volume') {
|
||||
progress.appendChild(createElement('span', null, '0'));
|
||||
|
||||
let suffix = '';
|
||||
switch (type) {
|
||||
case 'played':
|
||||
suffix = i18n.get('played', this.config);
|
||||
break;
|
||||
const suffixKey = ({
|
||||
played: 'played',
|
||||
buffer: 'buffered',
|
||||
})[type];
|
||||
|
||||
case 'buffer':
|
||||
suffix = i18n.get('buffered', this.config);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const suffix = suffixKey ? i18n.get(suffixKey, this.config) : '';
|
||||
|
||||
progress.innerText = `% ${suffix.toLowerCase()}`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user