change some icons

This commit is contained in:
Harvey committed 2022-04-29 10:14:19 +08:00
1 parent e2d016c28f
commit 208096f3c7
20 files changed
+302 -216

No files matched your search

+13 -3
View File
@@ -1,4 +1,4 @@
import { append, tooltip } from '../utils';
import { append, tooltip, setStyle } from '../utils';
export default function fullscreen(option) {
return (art) => ({
@@ -11,14 +11,24 @@ export default function fullscreen(option) {
i18n,
} = art;
append($control, icons.fullscreen);
const $fullscreenOn = append($control, icons.fullscreenOn);
const $fullscreenOff = append($control, icons.fullscreenOff);
setStyle($fullscreenOff, 'display', 'none');
proxy($control, 'click', () => {
art.fullscreen = !art.fullscreen;
});
art.on('fullscreen', (value) => {
tooltip($control, i18n.get(value ? 'Exit Fullscreen' : 'Fullscreen'));
if (value) {
tooltip($control, i18n.get('Exit Fullscreen'));
setStyle($fullscreenOn, 'display', 'none');
setStyle($fullscreenOff, 'display', 'inline-flex');
} else {
tooltip($control, i18n.get('Fullscreen'));
setStyle($fullscreenOn, 'display', 'inline-flex');
setStyle($fullscreenOff, 'display', 'none');
}
});
},
});