From 4d73b2e00b7e16ef3d31cefab7335e134eabd591 Mon Sep 17 00:00:00 2001 From: ouidade Date: Fri, 10 Dec 2021 17:39:07 +0100 Subject: [PATCH] comment preprocess field --- web/themes/custom/eql/eql.libraries.yml | 4 ++-- web/themes/custom/eql/eql.theme | 12 ++++++------ web/themes/custom/eql/scripts/main.js | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/web/themes/custom/eql/eql.libraries.yml b/web/themes/custom/eql/eql.libraries.yml index 84b410c..8e2ee85 100644 --- a/web/themes/custom/eql/eql.libraries.yml +++ b/web/themes/custom/eql/eql.libraries.yml @@ -5,6 +5,6 @@ global-css: global-js: js: scripts/main.js: {} - dependencies: - - core/jquery + # dependencies: + # - core/jquery diff --git a/web/themes/custom/eql/eql.theme b/web/themes/custom/eql/eql.theme index cf1ed44..91b9b19 100644 --- a/web/themes/custom/eql/eql.theme +++ b/web/themes/custom/eql/eql.theme @@ -37,13 +37,13 @@ function eql_preprocess_node(&$variables){ // $variables['elements']['#paragraph']->item_id; // } // la fonction suivante ne sert à rien -function eql_preprocess_field(&$variables) { +// function eql_preprocess_field(&$variables) { - $paragraph = &$variables['paragraph']; - $variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id(); - $hook_id = $paragraph->get('paragraph-id--')->getString(); - $variables['attributes']['class'][] = 'hook-id-' . $hook_id; -} +// $paragraph = &$variables['paragraph']; +// $variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id(); +// $hook_id = $paragraph->get('paragraph-id--')->getString(); +// $variables['attributes']['class'][] = 'hook-id-' . $hook_id; +// } //might be useful for if-clause: $variables['field_name'] and $variables['field_type'] // if ($paragraph && $paragraph->getEntityTypeId() == 'paragraph' . $paragraph->id() ) { //whatever logic you need goes here, e.g. something like diff --git a/web/themes/custom/eql/scripts/main.js b/web/themes/custom/eql/scripts/main.js index c0f8225..40b6165 100644 --- a/web/themes/custom/eql/scripts/main.js +++ b/web/themes/custom/eql/scripts/main.js @@ -35,14 +35,14 @@ function toggleFaq(event) { // fonction pour attribuer la class du parents -var fields = document.getElementsByClassName("field--name-field-titre"); -var paragraphs = document.getElementsByClassName("paragraph--type--texte"); -for (let i = 0; i < fields.length; i++) { - const field = fields[i] -} -function giveIdParent(){ - document.field.classList="paragraphs"; -} +// var fields = document.getElementsByClassName("field--name-field-titre"); +// var paragraphs = document.getElementsByClassName("paragraph--type--texte"); +// for (let i = 0; i < fields.length; i++) { +// const field = fields[i] +// } +// function giveIdParent(){ +// document.field.classList="paragraphs"; +// } // Function mouseOut () // {