Skip to content
Snippets Groups Projects
Commit 64cc2e70 authored by Junaid's avatar Junaid
Browse files

Issue #3432850 by Steve Hanson: Cannot seem to make this work right. Follow up...

Issue #3432850 by Steve Hanson: Cannot seem to make this work right. Follow up Remove jQuery dependency from the once feature (https://www.drupal.org/node/3158256)
parent b1aca5a9
No related branches found
No related tags found
No related merge requests found
(function ($, Drupal) {
(function ($, Drupal, once) {
// Ajax command to trigger event to notify loading of a component aka block in the layout.
Drupal.AjaxCommands.prototype.rlbTriggerLoadedEvent = function (ajax, response, status) {
$('[data-component-uuid=' + response.component_uuid + ']').parent().trigger('rlb:component-loaded');
......@@ -51,7 +51,7 @@
};
Drupal.behaviors.rlbBehavior = {
attach: function (context, settings) {
$('body', context).once('rlb').each(function () {
$(once('rlb', 'body', context)).each(function () {
// Loop over all component elements requiring dynamic loading.
$('*[data-rlb-to-be-loaded]').each(function(){
$component = $(this);
......@@ -93,4 +93,4 @@
});
}
};
})(jQuery, Drupal);
})(jQuery, Drupal, once);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment