fyneworks / star-rating

jQuery Star Rating Plugin
MIT License
29 stars 17 forks source link

Plugin doesn't initialize properly if inputs have class="star" #12

Open smohadjer opened 9 years ago

smohadjer commented 9 years ago

Why are you initializing plugin from inside the plugin? I'm referring to this line: https://github.com/fyneworks/star-rating/blob/master/jquery.rating.js#L404

This means users shouldn't use class="star" on input elements if they want to initialize plugin themselves otherwsie plugin will initialize twice and cause various bugs such as callback not executing anymore, etc.

fyneworks commented 9 years ago

I initialize the plugin within the plugin itself so the most novice of users don't have to do anything.

But what's the best practice here? Some of this code dates back 8 years. Happy to change if its better for the community.