Using Rateit with twitter bootstrap popover

Jul 9, 2013 at 9:16 PM
I am trying to get rateit to work in a twitter bootstrap popover. I need to reinitiate it when the popover shows but I am not having any luck with it.

I created a fiddle:

The fiddle just shows the range input slider though - not sure how to get it working there either.

Can anyone help me out?
Jul 10, 2013 at 7:30 AM

You cannot link to the sources in codeplex. They do not return css and js. Download the sources, put them on some server, and then everything will work.
Jul 10, 2013 at 4:25 PM
Edited Jul 10, 2013 at 4:26 PM
Thanks gidon - first time using jsFiddle.

I updated the files so you can see exactly what I have now.

The rateit at the top is working fine, but once you click the button and get the popover, the rateit in the popover is not working. Any help would be appreciated.
Jul 10, 2013 at 6:44 PM
Fixed it:

The thing is that when the popover is initialized, it clones the source element (the add-review-form) and puts it into the popover markup.
At this moment you have actually two 'add-review-forms' on your page.

The rateit bindings however are not cloned, so you end up with a half working rateit plugin.

The trick is , not to have rateit auto init the itself (I changed the div's class to rateit-popover), and then when the review button is clicked, and the popover is shown, only then we initialize it. Next time when the review button is clicked, it will happen again, but rateit is smart enough not to reinit itself once it is initialized.

Jul 10, 2013 at 7:23 PM
Awesome - I figured it was something simple but just couldn't figure it out. I appreciate your help. Thanks!