is there a javascript api for Drupal 8 flag like Drupal 7 ?

Created on 13 November 2019, over 5 years ago
Updated 28 February 2024, about 1 year ago

I want ot hook into the flag ajax command, do something in js after flag sucess. it is possile in Drupal 7:
https://www.drupal.org/node/336122
"
The Flag module provides us with two "pseudo" events to which we can attach our JavaScript handlers. These events are both triggered after content has been successfully flagged (or unflagged).
"

$(document).bind('flagGlobalAfterLinkUpdate', function(event, data) {
  alert('Object #' + data.contentId + ' (of type ' +
    data.contentType + ') has been ' + data.flagStatus +
    ' using flag "' + data.flagName + '"');
});

Is this possible in Drupal 8?

Feature request
Status

Active

Version

4.0

Component

User interface

Created by

🇨🇳China g089h515r806

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024