added boussole js library

This commit is contained in:
Bachir Soussi Chiadmi 2023-01-31 18:33:34 +01:00
parent 260c1c5b67
commit 71776320fe
3 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,15 @@
Drupal.behaviors.boussole = {
attach: function (context, settings) {
console.log("Hello boussole", context);
// Use context to filter the DOM to only the elements of interest,
// and use once() to guarantee that our callback function processes
// any given element one time at most, regardless of how many times
// the behaviour itself is called (it is not sufficient in general
// to assume an element will only ever appear in a single context).
// once('boussoleForm', 'input.myCustomBehavior', context).forEach(
// function (element) {
// element.classList.add('processed');
// }
// );
}
};

View File

@ -3,3 +3,9 @@ global-styling:
css: css:
theme: theme:
css/ouatminimal.css: {} css/ouatminimal.css: {}
boussole:
version: VERSION
js:
js/boussole.js: {}
dependencies:
- core/jquery

View File

@ -79,7 +79,7 @@ function ouatminimal_theme_suggestions_field_multiple_value_form_alter(array &$s
function ouatminimal_preprocess_field_multiple_value_form__field_entite__node_concernement(&$variables) { function ouatminimal_preprocess_field_multiple_value_form__field_entite__node_concernement(&$variables) {
// $element = $variables['element']; // $element = $variables['element'];
$attributes = $variables['attributes']; $attributes = $variables['attributes'];
$variables['#attached']['library'][] = 'ouatminimal/boussole';
} }
// template_preprocess_field_multiple_value_form // template_preprocess_field_multiple_value_form
// function ouatminimal_preprocess_field_multiple_value_form(&$variables) { // function ouatminimal_preprocess_field_multiple_value_form(&$variables) {