clean some event

This commit is contained in:
Harvey Zack committed 2018-11-22 11:09:28 +08:00
1 parent 3cd470a83c
commit d4b9fc4d29
5 files changed
+8 -29

No files matched your search

+1 -13
View File
@@ -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');
+4 -4
View File
@@ -190,10 +190,10 @@
width: 60px
}
}
&.art-volume-panel-hover {
width: 60px;
}
}
&:hover .art-volume-panel {
width: 60px;
}
}