letsrate icon indicating copy to clipboard operation
letsrate copied to clipboard

it can not work after adding readOnly option

Open sharp opened this issue 12 years ago • 0 comments

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.

sharp avatar Sep 14 '13 02:09 sharp