Skip to content

Allow changing step attribute #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Allow changing step attribute #103

wants to merge 1 commit into from

Conversation

northamerican
Copy link

The rz-slider-step attribute is static and does not change, as do the min and max. See #78, which was closed without a working solution.

@northamerican northamerican changed the title #102 - Allow changing step attribute Allow changing step attribute Aug 13, 2015
@ValentinH
Copy link
Member

I understand what you mean. However, as I said in #78, this change will probably break existing apps (like if someone is using rz-slider-step="{{ step }}").

Moreover, when changing the step with your solution, a NaN appears briefly above the slider so I think you are missing something... self.resetSlider(); maybe?

I think if we do this, we should do the same for the rz-slider-precision and other attrs using @ bindings to be more consistent... Then it would mean we bump to a breaking change release so 0.2.0.

@Martin-Luft
Copy link

If you don't want to break existing implementations why don't you introduce a new 'rz-slider-nonStaticStep' or something? I need this feature so you have my vote :) 👍

@ValentinH
Copy link
Member

Hmmm I'm not really fan of this solution because I already think that there are too many attributes on this directive.... I'm even considering using a rz-slider-options that would use an object containing all the non-mandatory fields and only keep rz-slider-model and rz-slider-high. Then all the options would be updatable at runtime.

What do you think of this solution? This would definitively be a 2.0 release.

@Martin-Luft
Copy link

Sounds good 👍

@Martin-Luft
Copy link

Stupid question... Why does this dynamic step change works?
https://jsfiddle.net/zfee1pxb/3/
https://jsfiddle.net/zfee1pxb/4/

@ValentinH
Copy link
Member

There is no watch on step alone but since you modify other properties that are watched (model for instance), the slider is refreshed and so the step is updated.

@Martin-Luft
Copy link

OK and here https://jsfiddle.net/zfee1pxb/5/ the update is triggered when moving the bubble right? So the only thing that does not work yet is that the bubble does not jump around when changing the step right?

@ValentinH
Copy link
Member

Not only because if you show the ticks on the slider, then they are not updated either:
https://jsfiddle.net/pom92p9r/

@ValentinH
Copy link
Member

I have started to implement what I mentioned above about rzSliderOptions:
https://github.com/rzajac/angularjs-slider/blob/2.0.0/src/rzslider.js#L34 .
What do you think?

@Martin-Luft
Copy link

It looks like mentioned :)

@ValentinH
Copy link
Member

Please see #158

@ValentinH ValentinH closed this Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants