pixelcrisis / turnstyles

turnstyles for turntable.fm | a chrome extension
14 stars 8 forks source link

Add scrollwheel support to volume slider #1

Closed Dazzuh closed 3 years ago

Dazzuh commented 3 years ago

also made the bar load with the current volume value

pixelcrisis commented 3 years ago

The bar already loads with the latest value in the most recent version, it's hard coded into the HTML template. I'm sorry, I forgot to push my most recent updates! Scroll wheel support is a great idea.

pixelcrisis commented 3 years ago

What I would recommend, taking the latest codebase into account:

change the event binding to:

$('#ts_slider')
    .on('input', this.onVolInput.bind(this))
    .on('DOMMouseScroll', this.onVolWheel.bind(this))

and then:

tS.prototype.onVolWheel = function(e) {
    console.log(e.target.value || e)
    // your code here
}