I want to do other stuff on my page after the AJAX flag/unflag request completes (update other stuff outside of the default flag message). However, I'm not seeing a clean way to tap into this. My jQuery is minimal so that could be part of the problem, also its the D5 version of jQuery/flag.module so it might be easier in 6. I'm wondering if there is an easy way to add in more JS handling that I'm not aware or interested in starting a discussion of how to best faciliate that.

For now I just had to modify my local copy of flag.js updateLink() adding

    if (($('.flagged', $newLink)).length == 0)
      $('#node-' + $(element).attr('id') + ' .node-status').html(' ');
    else
      $('#node-' + $(element).attr('id') + ' .node-status').html('You are registered to attend this event.');

This updates a div in the node that is permanent and not part of the AJAX flag message display. Works fine just not a very clean solution so I'm asking for advice.

Comments

dldege’s picture

quicksketch’s picture

Yep, follow the docs there. You'll need to use the development version I believe. Reopen if needing additional help, but those docs are all up-to-date and functioning.

quicksketch’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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