mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 19:01:20 -08:00
separate variable constants
This commit is contained in:
1 parent
57a14f63ac
commit
fc3abd7d1d
20 files changed
+143
-80
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { inverseClass, queryAll } from '../utils';
|
||||
|
||||
export default function aspectRatio(art) {
|
||||
const { i18n, icons } = art;
|
||||
const { i18n, icons, constructor } = art;
|
||||
|
||||
function getI18n(value) {
|
||||
return value === 'default' ? i18n.get('Default') : value;
|
||||
@@ -14,7 +14,7 @@ export default function aspectRatio(art) {
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
width: constructor.SETTING_ITEM_WIDTH,
|
||||
html: i18n.get('Aspect Ratio'),
|
||||
icon: icons.aspectRatio,
|
||||
tooltip: getI18n(art.aspectRatio),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { inverseClass, queryAll } from '../utils';
|
||||
|
||||
export default function flip(art) {
|
||||
const { i18n, icons } = art;
|
||||
const { i18n, icons, constructor } = art;
|
||||
|
||||
const keys = {
|
||||
normal: 'Normal',
|
||||
@@ -16,7 +16,7 @@ export default function flip(art) {
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
width: constructor.SETTING_ITEM_WIDTH,
|
||||
html: i18n.get('Video Flip'),
|
||||
tooltip: i18n.get(keys[art.flip]),
|
||||
icon: icons.config,
|
||||
|
||||
@@ -31,7 +31,6 @@ export default class Setting extends Component {
|
||||
this.name = 'setting';
|
||||
this.$parent = $setting;
|
||||
|
||||
this.width = 250;
|
||||
this.option = [];
|
||||
this.events = [];
|
||||
this.cache = new Map();
|
||||
@@ -241,7 +240,7 @@ export default class Setting extends Component {
|
||||
append($panel, this.creatItem(option[index]));
|
||||
}
|
||||
|
||||
$panel.dataset.width = width || this.width;
|
||||
$panel.dataset.width = width || this.art.constructor.SETTING_WIDTH;
|
||||
append(this.$parent, $panel);
|
||||
this.cache.set(option, $panel);
|
||||
inverseClass($panel, 'art-current');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { inverseClass, queryAll } from '../utils';
|
||||
|
||||
export default function playbackRate(art) {
|
||||
const { i18n, icons } = art;
|
||||
const { i18n, icons, constructor } = art;
|
||||
|
||||
function getI18n(value) {
|
||||
return value === 1.0 ? i18n.get('Normal') : value;
|
||||
@@ -14,7 +14,7 @@ export default function playbackRate(art) {
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
width: constructor.SETTING_ITEM_WIDTH,
|
||||
html: i18n.get('Play Speed'),
|
||||
tooltip: getI18n(art.playbackRate),
|
||||
icon: icons.playbackRate,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { inverseClass, queryAll } from '../utils';
|
||||
|
||||
export default function subtitleOffset(art) {
|
||||
const { i18n, icons } = art;
|
||||
const { i18n, icons, constructor } = art;
|
||||
|
||||
function getI18n(value) {
|
||||
return value === 0 ? i18n.get('Normal') : value;
|
||||
@@ -14,7 +14,7 @@ export default function subtitleOffset(art) {
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
width: constructor.SETTING_ITEM_WIDTH,
|
||||
html: i18n.get('Subtitle Offset'),
|
||||
tooltip: getI18n(art.subtitleOffset),
|
||||
icon: icons.subtitle,
|
||||
|
||||
Reference in new issue
Block a user