I'm using the following code to call a couple of functions which do ajax post. I found by not using data.preventDefault the functions seem to get triggered multiple times so I used data.preventDefault which fixed this. I just can't work out how to update the links once the functions have run.

$(document).bind('flagGlobalBeforeLinkUpdate', function(event, data) {
  if (data.flagName == 'event_attend' && data.flagStatus == 'flagged') {
    data.preventDefault = true;
    postAttend();
  }
  if (data.flagName == 'event_attend' && data.flagStatus == 'unflagged') {
    data.preventDefault = true;
    postNotattend();
  }
});

Comments

joachim’s picture

Status: Active » Fixed

Closing support requests older than a year. Feel free to reopen if this is still relevant.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.