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 #18

Open
wazery opened this issue Jul 30, 2014 · 0 comments
Open

it can not work after adding readOnly option #18

wazery opened this issue Jul 30, 2014 · 0 comments

Comments

@wazery
Copy link
Owner

wazery commented Jul 30, 2014

Issue by sharp
Saturday Sep 14, 2013 at 02:24 GMT
Originally opened as muratguzel#41


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