JS cleanup.

This commit is contained in:
JesseBrault0709 2024-06-12 07:21:18 +02:00
parent 8c953d5ce4
commit 56547573fd
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
window.addEventListener('load', function () {
window.addEventListener('load', () => {
const readMoreButton = document.getElementById('biography-read-more-button')
const biographyArticle = document.getElementById('biography-article')
readMoreButton.addEventListener('click', function () {
readMoreButton.addEventListener('click', () => {
biographyArticle.scrollIntoView({ behavior: 'smooth' })
})
})

View File

@ -78,7 +78,7 @@ window.addEventListener('load', () => {
},
method: 'POST'
})
.then(function (response) {
.then(response => {
if (response.status === 400) {
response.json().then(body => {
body.errors.forEach(({ field, message }) => {

View File

@ -1,7 +1,7 @@
window.addEventListener('load', function () {
window.addEventListener('load', () => {
const navBars = document.getElementById('nav-bars')
const navItems = document.getElementById('nav-items')
navBars.addEventListener('click', function () {
navBars.addEventListener('click', () => {
if (window.matchMedia('screen and (max-width: 1023px)').matches) {
if (navItems.style.display === 'flex') {
navItems.style.display = 'none'