button media js
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -289,3 +289,29 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
// //////////////////end tronquage sous titre //////////////////
|
||||
|
||||
////////////////// start boutons media ////////////////
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const mediaButtons = document.querySelectorAll('.buttons-filtres-ressources a');
|
||||
|
||||
mediaButtons.forEach(button => {
|
||||
button.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Récupérer l’ID media depuis l’URL du bouton
|
||||
const url = new URL(button.href);
|
||||
const mediaID = url.searchParams.get('field_type_de_media_target_id');
|
||||
|
||||
// Appliquer la valeur dans le <select>
|
||||
const select = document.getElementById('edit-field-type-de-media-target-id');
|
||||
if (select) {
|
||||
select.value = mediaID;
|
||||
// Simuler le clic sur le bouton "Appliquer"
|
||||
const submit = document.querySelector('input#edit-submit-base-de-donnees');
|
||||
if (submit) {
|
||||
submit.click();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
#}
|
||||
|
||||
<div class="buttons-filtres-ressources">
|
||||
{# <div class="buttons-filtres-ressources">
|
||||
<a class=" button button-videos" style="" href="https://stage.eql.figli.io/ressources?field_type_de_media_target_id=693&field_type_de_ressource_target_id=All&field_mots_clefs_target_id=All&field_date_de_parution_value=&combine="> Vidéos</a>
|
||||
|
||||
<a class="button button-podcasts" style="" href="https://stage.eql.figli.io/ressources?field_type_de_media_target_id=698&field_type_de_ressource_target_id=All&field_mots_clefs_target_id=All&field_date_de_parution_value=&combine="> Podcasts</a>
|
||||
@@ -22,9 +22,9 @@
|
||||
<a class="button button-livres" style="" href="https://stage.eql.figli.io/ressources?field_type_de_media_target_id=696&field_type_de_ressource_target_id=All&field_mots_clefs_target_id=All&field_date_de_parution_value=&combine="> Livres</a>
|
||||
<a class="button button-articles" style="" href="https://stage.eql.figli.io/ressources?field_type_de_media_target_id=694&field_type_de_ressource_target_id=All&field_mots_clefs_target_id=All&field_date_de_parution_value=&combine="> Articles</a>
|
||||
<a class="button button-publications-rapports" style="" href="https://stage.eql.figli.io/ressources?field_type_de_media_target_id=696&field_type_de_ressource_target_id=All&field_mots_clefs_target_id=All&field_date_de_parution_value=&combine="> Publications/rapports</a>
|
||||
</div>
|
||||
</div> #}
|
||||
|
||||
|
||||
{#
|
||||
<div class="buttons-filtres-ressources">
|
||||
{% for item in media_links %}
|
||||
<a
|
||||
@@ -35,7 +35,7 @@
|
||||
</a>
|
||||
|
||||
{% endfor %}
|
||||
</div> #}
|
||||
</div>
|
||||
|
||||
|
||||
<form{{ attributes }}>
|
||||
|
||||
Reference in New Issue
Block a user