mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
i18n改用json格式
This commit is contained in:
1 parent
ffd7a38b35
commit
0bc9c88af2
18 files changed
+211
-184
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { append, insertByIndex, setStyles, setStyle, remove } from './index';
|
||||
import { append, setStyles, setStyle, remove } from './index';
|
||||
|
||||
export default function component(art, parent, target, getOption, callback, title) {
|
||||
const option = typeof getOption === 'function' ? getOption(art) : getOption;
|
||||
@@ -15,7 +15,14 @@ export default function component(art, parent, target, getOption, callback, titl
|
||||
setStyles($element, option.style);
|
||||
}
|
||||
|
||||
insertByIndex(target, $element, option.index || parent.id);
|
||||
const childs = Array.from(target.children);
|
||||
$element.dataset.index = option.index || parent.id;
|
||||
const nextChild = childs.find(item => Number(item.dataset.index) >= Number($element.dataset.index));
|
||||
if (nextChild) {
|
||||
nextChild.insertAdjacentElement('beforebegin', $element);
|
||||
} else {
|
||||
append(target, $element);
|
||||
}
|
||||
|
||||
if (option.click) {
|
||||
art.events.proxy($element, 'click', event => {
|
||||
|
||||
Reference in new issue
Block a user