update mobile demo

This commit is contained in:
Harvey committed 2022-05-13 09:31:11 +08:00
1 parent 62ce58330e
commit de9005cf20
6 files changed
+59 -17

No files matched your search

+3 -3
View File
@@ -1,10 +1,10 @@
import { append, tooltip } from '../utils';
export default function subtitle(option) {
return art => ({
return (art) => ({
...option,
tooltip: art.i18n.get('Hide Subtitle'),
mounted: $control => {
mounted: ($control) => {
const {
events: { proxy },
icons,
@@ -18,7 +18,7 @@ export default function subtitle(option) {
subtitle.toggle = true;
});
art.on('subtitle', value => {
art.on('subtitle', (value) => {
tooltip($control, i18n.get(value ? 'Hide Subtitle' : 'Show Subtitle'));
});
},
+17
View File
@@ -270,6 +270,23 @@ export default class Setting extends Component {
},
});
const $tooltip = document.createElement('div');
addClass($tooltip, 'art-setting-item-right-tooltip');
append($tooltip, item.tooltip || '');
append($right, $tooltip);
item._$tooltip = $tooltip;
def(item, 'tooltip', {
get() {
return $tooltip.innerHTML;
},
set(value) {
if (typeof value === 'string' || typeof value === 'number') {
$tooltip.innerHTML = value;
}
},
});
const $switch = document.createElement('div');
addClass($switch, 'art-setting-item-right-icon');
const $switchOn = append($switch, icons.switchOn);
@@ -75,6 +75,7 @@
.art-setting-item-right-tooltip {
font-size: 12px;
margin-right: 5px;
white-space: nowrap;
color: rgba(255, 255, 255, 0.5);
}