angular-slider/angularjs-slider

Feature Request: Customize For Movie Clip Use with both range and value

f2chk opened this issue · 4 comments

f2chk commented

Steps to reproduce

Demo: http://jsfiddle.net/cwhgLcjv/ (fork this example and update the link)

Expected behaviour

I'd like to be able to edit a portion of a long movie clip by being able to replay a small range repeatedly.
I'd like to be able to have both a range and a value on the slider so that the slider value is between the range. Essentially three thumbs, one for the value and the two other for the range. Is it possible to configure?

Actual behaviour

Tell us what happens instead

Hi,

Unfortunately, this is not possible with this library. We only support 2 thumbs and supporting more would require a lot of changes.

What you can do is fork this library if you want.

trodi commented

@f2chk I had to add the functionality I think you need to my wrapper of this slider. I don't have an open source version of the wrapper, but basically what I did was to create multiple sliders (in your case 2 sliders) and edit the css and provide a custom html template to stack them on top of each other. It takes a bit of work, but it's worked great in my use cases.

An example of what mine looks like:
screen shot 2018-07-02 at 7 49 54 am

A few notes on what I did:

  • interval = 0 // force immediate model updates so stacked sliders can update each other immediately
    • Hook into onChange to update the models as desired (e.g., ensure the middle thumb is always between the two range thumbs).
  • onlyBindHandles = true // force user to slide handles since there are more than one slider stacked
  • I added variables to the customTemplateScopeso I would know how to override css to position each slider on top of one another and conditionally do things like hide the "// 2 The slider bar"

Awesome workaround @trodi 🎉

f2chk commented

@trodi sounds like a great idea! I will give it a try.