JS cleanup.
This commit is contained in:
		
							parent
							
								
									8c953d5ce4
								
							
						
					
					
						commit
						56547573fd
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
window.addEventListener('load', function () {
 | 
					window.addEventListener('load', () => {
 | 
				
			||||||
    const readMoreButton = document.getElementById('biography-read-more-button')
 | 
					    const readMoreButton = document.getElementById('biography-read-more-button')
 | 
				
			||||||
    const biographyArticle = document.getElementById('biography-article')
 | 
					    const biographyArticle = document.getElementById('biography-article')
 | 
				
			||||||
    readMoreButton.addEventListener('click', function () {
 | 
					    readMoreButton.addEventListener('click', () => {
 | 
				
			||||||
        biographyArticle.scrollIntoView({ behavior: 'smooth' })
 | 
					        biographyArticle.scrollIntoView({ behavior: 'smooth' })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
				
			|||||||
@ -78,7 +78,7 @@ window.addEventListener('load', () => {
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                method: 'POST'
 | 
					                method: 'POST'
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
                .then(function (response) {
 | 
					                .then(response => {
 | 
				
			||||||
                    if (response.status === 400) {
 | 
					                    if (response.status === 400) {
 | 
				
			||||||
                        response.json().then(body => {
 | 
					                        response.json().then(body => {
 | 
				
			||||||
                            body.errors.forEach(({ field, message }) => {
 | 
					                            body.errors.forEach(({ field, message }) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
window.addEventListener('load', function () {
 | 
					window.addEventListener('load', () => {
 | 
				
			||||||
    const navBars = document.getElementById('nav-bars')
 | 
					    const navBars = document.getElementById('nav-bars')
 | 
				
			||||||
    const navItems = document.getElementById('nav-items')
 | 
					    const navItems = document.getElementById('nav-items')
 | 
				
			||||||
    navBars.addEventListener('click', function () {
 | 
					    navBars.addEventListener('click', () => {
 | 
				
			||||||
        if (window.matchMedia('screen and (max-width: 1023px)').matches) {
 | 
					        if (window.matchMedia('screen and (max-width: 1023px)').matches) {
 | 
				
			||||||
            if (navItems.style.display === 'flex') {
 | 
					            if (navItems.style.display === 'flex') {
 | 
				
			||||||
                navItems.style.display = 'none'
 | 
					                navItems.style.display = 'none'
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user