From 3b5775e42fec76c3d41cc95311a6fc7197d7acac Mon Sep 17 00:00:00 2001 From: Avi Schwab Date: Mon, 3 Jul 2023 11:38:52 -0500 Subject: [PATCH] fix: Restore FAQ accordion functionality in D10 --- openy_prgf/modules/openy_prgf_faq/js/paragraph.js | 3 ++- openy_prgf/modules/openy_prgf_faq/openy_prgf_faq.libraries.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) 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