mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
clean some event
This commit is contained in:
1 parent
3cd470a83c
commit
d4b9fc4d29
5 files changed
+8
-29
No files matched your search
@@ -10,7 +10,7 @@ export default class Volume {
|
||||
apply(art, $control) {
|
||||
this.art = art;
|
||||
const {
|
||||
events: { proxy, hover },
|
||||
events: { proxy },
|
||||
player,
|
||||
i18n,
|
||||
} = art;
|
||||
@@ -35,16 +35,6 @@ export default class Volume {
|
||||
player.muted = false;
|
||||
});
|
||||
|
||||
hover(
|
||||
$control,
|
||||
() => {
|
||||
this.$volumePanel.classList.add('art-volume-panel-hover');
|
||||
},
|
||||
() => {
|
||||
this.$volumePanel.classList.remove('art-volume-panel-hover');
|
||||
},
|
||||
);
|
||||
|
||||
proxy(this.$volumePanel, 'click', event => {
|
||||
player.muted = false;
|
||||
player.volume = this.volumeChangeFromEvent(event);
|
||||
@@ -86,8 +76,6 @@ export default class Volume {
|
||||
// TODO...
|
||||
const panelWidth = getStyle(this.$volumePanel, 'width') || 60;
|
||||
const handleWidth = getStyle(this.$volumeHandle, 'width');
|
||||
console.log('panelWidth', panelWidth);
|
||||
console.log('handleWidth', handleWidth);
|
||||
const width = handleWidth / 2 + (panelWidth - handleWidth) * percentage - handleWidth / 2;
|
||||
setStyle(this.$volume, 'display', 'flex');
|
||||
setStyle(this.$volumeClose, 'display', 'none');
|
||||
|
||||
@@ -190,10 +190,10 @@
|
||||
width: 60px
|
||||
}
|
||||
}
|
||||
|
||||
&.art-volume-panel-hover {
|
||||
width: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover .art-volume-panel {
|
||||
width: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user