mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:51:20 -08:00
4.3.1
This commit is contained in:
1 parent
222f786b88
commit
ce677ef602
62 files changed
+245
-224
No files matched your search
@@ -133,13 +133,13 @@ export default class Setting extends Component {
|
||||
append($left, item.html);
|
||||
|
||||
if (hasChildren) {
|
||||
const $description = document.createElement('div');
|
||||
addClass($description, 'art-setting-item-right-description');
|
||||
append($right, $description);
|
||||
item._$description = $description;
|
||||
const $tooltip = document.createElement('div');
|
||||
addClass($tooltip, 'art-setting-item-right-tooltip');
|
||||
append($right, $tooltip);
|
||||
item._$tooltip = $tooltip;
|
||||
|
||||
if (item.description) {
|
||||
$description.innerHTML = item.description;
|
||||
if (item.tooltip) {
|
||||
$tooltip.innerHTML = item.tooltip;
|
||||
}
|
||||
|
||||
const $iconRight = document.createElement('div');
|
||||
@@ -160,9 +160,9 @@ export default class Setting extends Component {
|
||||
|
||||
if (item._parentItem && item._parentItem.onSelect) {
|
||||
const result = item._parentItem.onSelect.call(this.art, item, $item, event);
|
||||
if (item._parentItem._$description) {
|
||||
if (item._parentItem._$tooltip) {
|
||||
if (typeof result === 'string' || typeof result === 'number') {
|
||||
item._parentItem._$description.innerHTML = result;
|
||||
item._parentItem._$tooltip.innerHTML = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,11 @@ export default class Setting extends Component {
|
||||
}
|
||||
|
||||
add(callback) {
|
||||
this.option.push(callback(this.art));
|
||||
if (typeof callback === 'function') {
|
||||
this.option.push(callback(this.art));
|
||||
} else {
|
||||
this.option.push(callback);
|
||||
}
|
||||
this.option = makeRecursion(this.option);
|
||||
this.init(this.option);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user