mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 05:41:20 -08:00
压缩字符
This commit is contained in:
1 parent
baaaa4c56c
commit
ee90291897
13 files changed
+216
-280
No files matched your search
@@ -1,5 +1,3 @@
|
||||
import { defineProperty } from './property';
|
||||
|
||||
export function query(selector, parent = document) {
|
||||
return parent.querySelector(selector);
|
||||
}
|
||||
@@ -63,28 +61,3 @@ export function tooltip(target, msg, pos = 'up') {
|
||||
target.setAttribute('aria-label', msg);
|
||||
target.setAttribute('data-balloon-pos', pos);
|
||||
}
|
||||
|
||||
export function addShowProperty(target, ref, name) {
|
||||
const className = `art-${name}-show`;
|
||||
|
||||
defineProperty(target, 'show', {
|
||||
get() {
|
||||
return hasClass(ref, className);
|
||||
},
|
||||
set(value) {
|
||||
if (value) {
|
||||
addClass(ref, className);
|
||||
} else {
|
||||
removeClass(ref, className);
|
||||
}
|
||||
|
||||
target.art.emit(`${name}:toggle`, value);
|
||||
},
|
||||
});
|
||||
|
||||
defineProperty(target, 'toggle', {
|
||||
value: () => {
|
||||
target.show = !target.show;
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user