fix
parent
480d22d60c
commit
61bc97df63
|
@ -18,6 +18,7 @@ class Scroll extends Component {
|
|||
distance: 0
|
||||
}
|
||||
dragging = false
|
||||
hovering = false
|
||||
static styles = [
|
||||
css`
|
||||
:host {
|
||||
|
@ -85,10 +86,12 @@ class Scroll extends Component {
|
|||
}
|
||||
|
||||
onmouseenter() {
|
||||
this.hovering = true
|
||||
this.$refs.vertical.style.opacity = 0.3
|
||||
this.$refs.horizon.style.opacity = 0.3
|
||||
}
|
||||
onmouseleave() {
|
||||
this.hovering = false
|
||||
if (!this.dragging) {
|
||||
this.$refs.vertical.style.opacity = 0
|
||||
this.$refs.horizon.style.opacity = 0
|
||||
|
@ -131,8 +134,10 @@ class Scroll extends Component {
|
|||
|
||||
this.onmouseup = bind(document, 'mouseup', () => {
|
||||
this.dragging = false
|
||||
this.$refs.vertical.style.opacity = 0
|
||||
this.$refs.horizon.style.opacity = 0
|
||||
if (!this.hovering) {
|
||||
this.$refs.vertical.style.opacity = 0
|
||||
this.$refs.horizon.style.opacity = 0
|
||||
}
|
||||
unbind(document, 'mousemove', onmousemove)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue