summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/contextual/js/contextual.es6.js
diff options
context:
space:
mode:
authorwebchick <drupal@webchick.net>2017-10-16 18:15:27 -0400
committerwebchick <drupal@webchick.net>2017-10-16 18:15:27 -0400
commit18f322a212d777e4f2c364fd8cc7ecfe442cf24c (patch)
treec4e632f0fd8efd7d95159e586e2f56ff2dc64309 /core/modules/contextual/js/contextual.es6.js
parentfd8d98399a69ba243679fc8ecc1d8bf221c18530 (diff)
downloaddrupal-18f322a212d777e4f2c364fd8cc7ecfe442cf24c.tar.gz
drupal-18f322a212d777e4f2c364fd8cc7ecfe442cf24c.zip
Issue #2764931 by tedbow, tim.plunkett, nod_, drpal, droplet, dawehner, Wim Leers, phenaproxima: Contextual links don't work with 'use-ajax' links
Diffstat (limited to 'core/modules/contextual/js/contextual.es6.js')
-rw-r--r--core/modules/contextual/js/contextual.es6.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/modules/contextual/js/contextual.es6.js b/core/modules/contextual/js/contextual.es6.js
index 8c2b1aed4017..286e1ef9566f 100644
--- a/core/modules/contextual/js/contextual.es6.js
+++ b/core/modules/contextual/js/contextual.es6.js
@@ -249,4 +249,19 @@
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));