mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 17:46:17 -08:00
Refactor Setting class to fix state loss issue, update range callback return type, and remove isStringOrNumber utility function
This commit is contained in:
1 parent
191c7736c4
commit
b949fedc06
9 files changed
+22
-40
No files matched your search
@@ -10,7 +10,6 @@ import {
|
||||
inverseClass,
|
||||
createElement,
|
||||
} from './dom';
|
||||
import { isStringOrNumber } from './format';
|
||||
import { errorHandle } from './error';
|
||||
import validator from 'option-validator';
|
||||
import { ComponentOption } from '../scheme';
|
||||
@@ -143,10 +142,7 @@ export default class Component {
|
||||
const find = option.selector[index] || {};
|
||||
$value.innerText = $item.innerText;
|
||||
if (option.onSelect) {
|
||||
const result = await option.onSelect.call(this.art, find, $item, event);
|
||||
if (isStringOrNumber(result)) {
|
||||
$value.innerHTML = result;
|
||||
}
|
||||
$value.innerHTML = await option.onSelect.call(this.art, find, $item, event);
|
||||
}
|
||||
setLeft();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user