From 07f4cf1635795a90dbd8f83e0668543b9a3ad59b Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 29 Oct 2025 22:07:37 +0100 Subject: =?UTF-8?q?logos=20noirs=20quand=20d=C3=A9s=C3=A9lectionn=C3=A9s,?= =?UTF-8?q?=20Fetcher=20utilis=C3=A9=20dans=20menu.js=20"checkMenuEntry"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/main.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'public/js/main.js') diff --git a/public/js/main.js b/public/js/main.js index 3cc144a..39a31f5 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -206,15 +206,12 @@ function checkSocialNetwork(id){ endpoint: 'index.php?head_foot_social_check=' + id, method: 'POST', onSuccess: (data) => { - console.log(data); - checkbox.checked = data.checked; - - /*const color = checkbox.checked ? "#ff1d04" : "grey"; - clicked_menu_entry.querySelector("button").style.color = color;*/ + document.getElementById(id + '_content').src = 'assets/' + id.split('_')[1] + (data.checked ? '': '-nb') + '.svg'; // assets/facebook.svg ou assets/facebook-nb.svg + toastNotify('Le logo "' + id.split('_')[1] + '" ' + (data.checked ? 'sera' : 'ne sera pas') + ' affiché aux visiteurs.'); }, onFailure: (data) => { - console.log(data); + console.error(data.message || "Erreur serveur"); } }) .send({checked: checkbox.checked}); -- cgit v1.2.3