This commit is contained in:
Harvey authored and Harvey Zack committed 2022-02-11 11:20:54 +08:00
1 parent 5e9057f060
commit 4d66a8538d
18 files changed
+137 -118

No files matched your search

@@ -5,11 +5,11 @@ export default function aspectRatio(art) {
width: 150,
html: i18n.get('Aspect Ratio'),
icon: icons.aspectRatio,
children: ['default', '4:3', '16:9'].map((item) => {
selector: ['default', '4:3', '16:9'].map((item) => {
return {
html: item === 'default' ? i18n.get('Default') : item,
current: item === 'default',
click() {
onSelect() {
art.aspectRatio = item;
},
};
+2 -2
View File
@@ -10,11 +10,11 @@ export default function playbackRate(art) {
return {
width: 150,
html: i18n.get('Video Flip'),
children: Object.keys(keys).map((key) => {
selector: Object.keys(keys).map((key) => {
return {
html: i18n.get(keys[key]),
current: key === 'normal',
click() {
onSelect() {
art.flip = key;
},
};
+8 -8
View File
@@ -8,13 +8,13 @@ import { append, addClass, setStyle, inverseClass, includeFromEvent } from '../u
function makeRecursion(option) {
for (let index = 0; index < option.length; index++) {
const item = option[index];
if (!item.back && item.children) {
item.children.unshift({
if (!item.back && item.selector) {
item.selector.unshift({
html: item.html,
children: option,
selector: option,
back: true,
});
makeRecursion(item.children);
makeRecursion(item.selector);
}
}
return option;
@@ -90,7 +90,7 @@ export default class Setting extends Component {
} = this.art;
const $item = document.createElement('div');
const hasChildren = item.children && item.children.length;
const hasChildren = item.selector && item.selector.length;
const $left = append($item, `<div class="art-setting-item-left"></div>`);
const $right = append($item, `<div class="art-setting-item-right"></div>`);
@@ -116,12 +116,12 @@ export default class Setting extends Component {
}
proxy($item, 'click', (event) => {
if (typeof item.click === 'function') {
item.click.call(this.art, this, event);
if (typeof item.onSelect === 'function') {
item.onSelect.call(this.art, this, event);
}
if (hasChildren) {
this.init(item.children);
this.init(item.selector);
setStyle(this.$parent, 'width', `${item.width || this.width}px`);
} else {
inverseClass($item, 'art-current');
@@ -5,11 +5,11 @@ export default function playbackRate(art) {
width: 150,
html: i18n.get('Play Speed'),
icon: icons.playbackRate,
children: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0].map((item) => {
selector: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0].map((item) => {
return {
html: item === 1.0 ? i18n.get('Normal') : item,
current: item === 1.0,
click() {
onSelect() {
art.playbackRate = item;
},
};
@@ -5,11 +5,11 @@ export default function subtitleOffset(art) {
width: 150,
html: i18n.get('Subtitle Offset'),
icon: icons.subtitle,
children: [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5].map((item) => {
selector: [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5].map((item) => {
return {
html: item === 0 ? i18n.get('Normal') : item,
current: item === 0,
click() {
onSelect() {
art.subtitleOffset = item;
},
};