I have a view displaying multiple nodes with their associated vote widgets.
I have a JS file including the following code:

Drupal.behaviors.response = {
        attach: function (context, settings) {
            $(document).bind('eventAfterRate', function(event, rate_data)
            {
              alert('called');
           }
       }
}

The first time a vote is cast by clicking on a widget, the above script runs once. The second time a vote is cast, by clicking on another node's widget (Only a single vote allowed per node), the script runs twice. On the third vote, the script runs 3X. etc.

Comments

msypes’s picture

Update:
I now see this isn't an issue with this module, but system-wide "fact of life." Every time the AJAX call to update the votes is called, my Javascript file is loaded anew and appended to what I already have, so it's attached multiple times.
If there's a way to prevent this behavior, I'd love a response. In the meantime, I've added logic to prevent multiple executions within the script itself.

msypes’s picture

Category: Bug report » Support request
Priority: Normal » Minor