diff options
Diffstat (limited to 'public/js/main.js')
| -rw-r--r-- | public/js/main.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/public/js/main.js b/public/js/main.js index 59a9331..3cc144a 100644 --- a/public/js/main.js +++ b/public/js/main.js | |||
| @@ -199,6 +199,27 @@ function findParentByTagName(element, tag_name){ | |||
| 199 | return null; | 199 | return null; |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | function checkSocialNetwork(id){ | ||
| 203 | const checkbox = document.getElementById(id).querySelector('input[type="checkbox"]'); | ||
| 204 | |||
| 205 | new Fetcher({ | ||
| 206 | endpoint: 'index.php?head_foot_social_check=' + id, | ||
| 207 | method: 'POST', | ||
| 208 | onSuccess: (data) => { | ||
| 209 | console.log(data); | ||
| 210 | |||
| 211 | checkbox.checked = data.checked; | ||
| 212 | |||
| 213 | /*const color = checkbox.checked ? "#ff1d04" : "grey"; | ||
| 214 | clicked_menu_entry.querySelector("button").style.color = color;*/ | ||
| 215 | }, | ||
| 216 | onFailure: (data) => { | ||
| 217 | console.log(data); | ||
| 218 | } | ||
| 219 | }) | ||
| 220 | .send({checked: checkbox.checked}); | ||
| 221 | } | ||
| 222 | |||
| 202 | 223 | ||
| 203 | /* -- fonctions spécifiques à la gestion des dates -- */ | 224 | /* -- fonctions spécifiques à la gestion des dates -- */ |
| 204 | 225 | ||
