Thanks for this great module which is really helpful.

I've created a views-block for the bookmark-flags, which I placed in the left column.

But now I have the problem, that this block is not refreshed if a node is flagged and so the newly flagged node does not show up in the block (or is not deleted if unflagged). To see the right block content I have to reload the page.
Is there any chance to refresh the block at the same time when the flag is toggled?

Comments

sirkitree’s picture

While this is definitely possible, the generalized version of the code that it would take to do this across sites would be very difficult to support.

I would suggest that you do this on your site within your own custom javascript.

mooffie’s picture

Component: User interface » Documentation

(A note to ourselves: we should prepare a handbook page explaining how to trigger user javascript code when a Flag ajax response completes. It could be useful. And surely some module exists to refresh a block via ajax.)

sirkitree’s picture

Do you think this should be part of the "Theming guide"? Or it's own Section alongside? Be glad to start it.

mooffie’s picture

Sirkitree, I'd be elated if you started it. It can be in the "Theming Guide" for the time being, till we have enough howtos to fork a "Miscellaneous recipes" section.

Some food for thought:
- jQuery has an ajaxComplete event (Can we restrict it to a certain flag?).
- In D6 one simply adds "scripts[] = myscript.js" to themename.info.
- To search "ajax block", or just "ajax", in the downloads here.

sirkitree’s picture

Got it started, very base outline so far http://drupal.org/node/336122

mooffie’s picture

Status: Active » Closed (duplicate)

I'm marking this a duplicate of a new feature:

#338417: Have a "flagSuccess" javascript event

(Sirkitree, could you please delete the page you kindly started? It isn't needed anymore, at least not in its current form. Of course, it could be updated, but until this happens users reading the Guide will get confused.)

sirkitree’s picture

The page that I started works to document the current code which is still relevant.

mooffie’s picture

Sirkitree, can you demonstrate how that page is in any way helpful?