eddysilvamendes / jquery-star-rating-plugin

Automatically exported from code.google.com/p/jquery-star-rating-plugin
0 stars 0 forks source link

copy data to the element #144

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Yo.
I needed the star to inherit the data collection from the radio input.
I figure this is a pretty cool thing to do and I tried it, it works great, it 
makes the plugin better, and now I suggest that you could make the same change 
to the master copy.
If this was on something like github then I would fork it and push it and send 
you a pull request. 

See my addition with the +'s beside it

            // inherit attributes from input element
            if(this.id) star.attr('id', this.id);
            if(this.className) star.addClass(this.className);

+           for (datum in $(this).data()) {
+               star.data(datum, $(this).data(datum));
+           }

            // Half-stars?
            if(control.half) control.split = 2;

            // Prepare division control
            if(typeof control.split=='number' && control.split>0){

Original issue reported on code.google.com by httpwebw...@gmail.com on 25 Jul 2014 at 4:08

GoogleCodeExporter commented 8 years ago
Thanks for sharing! We are on github now. 
https://github.com/fyneworks/star-rating/commit/9b6004085d89ec6da5de86cd14886f8d
e237ad97

Original comment by di...@fyneworks.com on 28 Aug 2014 at 3:23