Hi,
Right now Flag offers 3 options on flag creation: JS toggle, confirmation page, normal link.
But my request is for a 4th option: "JS refresh the node teaser" (and the full node if we are in full node view).
Why?
Because when a user flags something (node or whatever), he takes an action of sorts - he changes the status of that node, and in many cases it would be very convenient to show the user the immediate results of his flagging action.
Take as an example a scenario whereby flagging means removing a node from a list of teasers, by altering it's CSS class (Flag already does this, see http://drupal.org/node/312220) and adding "display:none". This "display:none" will only come into effect on the next pageload - because that node has not been refreshed yet. If you choose a JS toggle that's not good enough because all it does is display a new message, while the node teaser is still in the list. So a user may think "oops, this website is buggy". But if there was a way for a JS to refresh the flagged node, then we would be able to immediately see the effect of flagging take place.
What do you think?
Comments
Comment #1
quicksketchI think that this option would constantly have unexpected side-effects and not work properly in a lot of situations (such as Views with the Flag link in a row, or a manually themed link). If you want this functionality, you can use the Flag JavaScript API to hide elements immediately after flagging. See http://drupal.org/node/336122.
Comment #2
mooffie commentedI'm marking this a duplicate of:
Almost the same question, which you asked the other day:
#818788: Need help with "Bury" flag javascript
A way to implement this using some other means:
#926252: Factor out the JavaScript info building