diff --git a/openy_prgf/modules/openy_prgf_faq/js/paragraph.js b/openy_prgf/modules/openy_prgf_faq/js/paragraph.js index 070d4f7e..86f1a3dc 100644 --- a/openy_prgf/modules/openy_prgf_faq/js/paragraph.js +++ b/openy_prgf/modules/openy_prgf_faq/js/paragraph.js @@ -5,7 +5,8 @@ (function ($) { Drupal.behaviors.openyFaqParagraph = { attach: function( context ) { - $( context ).find( '.paragraph--type--faq-item' ).once( 'paragraphFaq' ).each( function () { + $(once('paragraphFaq', '.paragraph--type--faq-item', context)) + .each(function () { // Q/A wrapper. var wrapper = $( this ); // Question click event. diff --git a/openy_prgf/modules/openy_prgf_faq/openy_prgf_faq.libraries.yml b/openy_prgf/modules/openy_prgf_faq/openy_prgf_faq.libraries.yml index cd96033a..d36a51f6 100644 --- a/openy_prgf/modules/openy_prgf_faq/openy_prgf_faq.libraries.yml +++ b/openy_prgf/modules/openy_prgf_faq/openy_prgf_faq.libraries.yml @@ -2,3 +2,6 @@ paragraph: version: 1.x js: js/paragraph.js: {} + dependencies: + - core/jquery + - core/once