Skip to content
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

it can not work after adding readOnly option #41

Open
sharp opened this issue Sep 14, 2013 · 0 comments
Open

it can not work after adding readOnly option #41

sharp opened this issue Sep 14, 2013 · 0 comments

Comments

@sharp
Copy link

sharp commented Sep 14, 2013

In letsrate.js.erb:

$(function(){ 
    $(".star").raty({                  
        score: function(){
            return $(this).attr('data-rating')              
        }, 
        number: function() {
            return $(this).attr('data-star-count')
        },
        readOnly: function() {
            //console.log('sss')
            return false;//$(this).attr('data-readonly') == 'true'      
        },
        click: function(score, evt) {
            $.post('<%= Rails.application.class.routes.url_helpers.rate_path %>', 
                {
                    score: score, 
                    dimension: $(this).attr('data-dimension'),  
                    id: $(this).attr('data-id'),
                    klass: $(this).attr('data-classname')
                }, 
                function(data) {
                    if(data) {
                        // success code goes here ... 
                    }
            });
        }                        
    });           
});

If I add readOnly option , no matter it is true or false, the star can not be clicked.

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

No branches or pull requests

1 participant