-
Notifications
You must be signed in to change notification settings - Fork 155
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
reset on modal load #20
Comments
I think I'm looking to do something similar - I use PJAX (https://github.com/defunkt/jquery-pjax) to load new pages. When I have a bootstrap-rating-input on a page, and then I swap that page out, the same input on subsequent pages with different data are not caught by the bootstrap-rating-input code - they render as number-selecter inputs. I've tried calling varieties of the last two lines of your code, to re-run rating() on newly added inputs in the DOM, but I'm struggling to figure out exactly how. It would be sweet if there were an easily callable way to have the BRI code re-run.... Or any insight on how to get BRI to re-run to detect new inputs added to the DOM after document.ready... |
I also had a similar problem at UW-Madison. We wanted to set a value and then have the stars redrawn to reflect that value. We use a modal and we don't set the stars (db hit) until the modal is shown. So we have to have it initially made, then the values set, then the stars drawn out to reflect this. My latest commit does that. Maybe you could use it to reset the value to zero on an event and then redraw the stars to zero? Take a look: https://github.com/vertein/bootstrap-rating-input. Let me know if you want to see my code in action. |
There is not a "clean" way to reset it yet, but I'd try to remove the stars from the DOM, add a new |
@vertein your code looks really good and implement some of the most requested features, I'd really appreciate if you want to send a pull request ;-) |
thanks for the great code.
I am using it on a bootstrap 3 modal form. i want to reset the rating after the form is closed, so next time I load the form it is zero and not whatever the last rating was. struggling with how to do this. Any insight would be appreciated.
The text was updated successfully, but these errors were encountered: