document.addEventListener('DOMContentLoaded', function() {
  var logo = document.querySelector('.navbar-brand')
  var logoText = document.querySelector('.logo-text')
  var logoImg = document.querySelector('.logo-img')

  var navToggle = document.querySelector('.navbar-toggler')

  navToggle.addEventListener('click', function() {
    logoText.classList.toggle('expanded')
    logoImg.classList.toggle('expanded')
    logo.classList.toggle('expanded')
  })

  // Collapses the navbar if a click is made outside it
  document.addEventListener('click', function(event) {
    var navbar = document.querySelector('.navbar-collapse')
    var collapseButton = document.querySelector('.navbar-toggler-icon + .close')

    var navbarOpened = navbar.classList.contains('show')
    var linkClicked = event.target.tagName.toLowerCase() === 'a'

    if (navbarOpened && !linkClicked) collapseButton.click()
  })
})

@@ -453,451 +453,8 @@
   %7D)
-%0A%0A  // Collapses the navbar if a click is made outside it%0A  document.addEventListener('click', function(event) %7B%0A    var navbar = document.querySelector('.navbar-collapse')%0A    var collapseButton = document.querySelector('.navbar-toggler-icon + .close')%0A%0A    var navbarOpened = navbar.classList.contains('show')%0A    var linkClicked = event.target.tagName.toLowerCase() === 'a'%0A%0A    if (navbarOpened && !linkClicked) collapseButton.click()%0A  %7D)
 %0A%7D)%0A

Remove click event listener