mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
27 lines
671 B
JavaScript
27 lines
671 B
JavaScript
import { append, tooltip } from '../utils';
|
|
|
|
export default function subtitle(option) {
|
|
return art => ({
|
|
...option,
|
|
tooltip: art.i18n.get('Hide subtitle'),
|
|
mounted: $control => {
|
|
const {
|
|
events: { proxy },
|
|
icons,
|
|
i18n,
|
|
subtitle,
|
|
} = art;
|
|
|
|
append($control, icons.subtitle);
|
|
|
|
proxy($control, 'click', () => {
|
|
subtitle.toggle = true;
|
|
});
|
|
|
|
art.on('subtitle', value => {
|
|
tooltip($control, i18n.get(value ? 'Hide subtitle' : 'Show subtitle'));
|
|
});
|
|
},
|
|
});
|
|
}
|