Skip to content

Problems with initial rendering and "rzSliderForceRender" - "bullets are aligned at left side" #116

New issue

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

By clicking “No 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? No Sign in to your account

Closed
artgryn opened this issue Sep 2, 2015 · 10 comments

Comments

@artgryn
Copy link

artgryn commented Sep 2, 2015

In some projects slider rendered wrong(bullets are aligned at left side) from the initial view join. Also well known bug with ng-show/ng-hide usage. This bug partly can be solved by using "timeout" and "rzSliderForceRender". But that is ugly solution:

  1. "timeout" is not good to use in general
  2. "rzSliderForceRender" use require "broadcast" to "$rootScope" that is also not really recommended for AngularJS.

Solution: introduce public interfaces ".redraw()", ".reset()".

@ValentinH
Copy link
Member

On what object do you want to add these methods?

@artgryn
Copy link
Author

artgryn commented Sep 3, 2015

I didn't check source code and general architecture but ideal situation for me when you can add it like a dependency to the controller:

app.module('yourApp').controller('controller1', ['$scope', '$state', '$rootScope', 'rZslider',
        function($scope, $state, $rootScope, rZslider) {
             rZslider.redraw();

Or add any other way to render slider after some events.

@ValentinH
Copy link
Member

I didn't noticed on your first comment, but you don't need to broadcast on the root scope. Just on the controller scope where the slider is included.

Then, the RZSlider service is a factory on which we call new in the link function so you can't access it like you mentioned. See https://github.com/rzajac/angularjs-slider/blob/master/rzslider.js#L1251

@yogeshk25
Copy link

I am also experiencing same issue. can anyone tell me how to use rzSliderForceRender ?

@ValentinH
Copy link
Member

See #79

@asso1985
Copy link

Same for me here, tried with all the broadcasting events like reCalcViewDimensions and rzSliderForceRender, giving any kind of timeout but still getting the same problem.

@ValentinH
Copy link
Member

image

@asso1985
Copy link

AHAHAHAHAHAHAHAHAHAH

Ok sorry Valentin, I'll try to but the app is kinda big. I'll be back soon,
thanks.

2016-07-29 10:18 GMT+02:00 Valentin Hervieu notifications@github.com:

[image: image]
https://cloud.githubusercontent.com/assets/2678610/17242120/bcedc456-5575-11e6-8159-8126ee3619ce.png


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#116 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABHFGUCL3lmdS_8jjTOqkxsmu-QbV4vrks5qabdDgaJpZM4F2go5
.

@varunwinni
Copy link

Hi All, I am implementing Rzslider for time range But I am facing some issues. And I already ask in stackoverflow Please look at this. https://stackoverflow.com/questions/45429746/dont-lose-previous-position-of-rzslider-after-select-the-date-in-angular-js?noredirect=1#comment77835931_45429746

@ValentinH
Copy link
Member

I added a comment on Stack Overflow ;)

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants