Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / contextual / js / contextual.es6.js
index 8c2b1aed4017efc12e717f1de8b67c36729bd68b..701ed126cb0749e9a4a933447d7916e0a6aab82a 100644 (file)
   Drupal.theme.contextualTrigger = function () {
     return '<button class="trigger visually-hidden focusable" type="button"></button>';
   };
+
+  /**
+   * Bind Ajax contextual links when added.
+   *
+   * @param {jQuery.Event} event
+   *   The `drupalContextualLinkAdded` event.
+   * @param {object} data
+   *   An object containing the data relevant to the event.
+   *
+   * @listens event:drupalContextualLinkAdded
+   */
+  $(document).on('drupalContextualLinkAdded', (event, data) => {
+    Drupal.ajax.bindAjaxLinks(data.$el[0]);
+  });
 }(jQuery, Drupal, drupalSettings, _, Backbone, window.JSON, window.sessionStorage));