ESLINT tests should pass now.

Added some changes to fix ESLINT issues
pull/2665/head
Yegor 5 years ago committed by GitHub
parent 460033823a
commit ef95d74ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      apps/block_scout_web/assets/js/pages/layout.js

@ -7,41 +7,40 @@ $(document).click(function (event) {
$('.navbar-toggler').click() $('.navbar-toggler').click()
} }
}) })
$(document).ready(function() { $(document).ready(function () {
if (matchMedia) { if (matchMedia) {
var mq = window.matchMedia("(max-width: 900px)"); var mq = window.matchMedia('(max-width: 900px)')
mq.addListener(WidthChange); mq.addListener(WidthChange)
WidthChange(mq); WidthChange(mq)
} }
function WidthChange(mq) { function WidthChange (mq) {
if (mq.matches) { if (mq.matches) {
$("#checkIfSmall").removeClass("dropdown-menu"); $('#checkIfSmall').removeClass('dropdown-menu')
$(".dropdown-item").removeClass("active"); $('.dropdown-item').removeClass('active')
$("#checkIfSmall1").removeClass("dropdown-menu"); $('#checkIfSmall1').removeClass('dropdown-menu')
$("#checkIfSmall2").removeClass("dropdown-menu"); $('#checkIfSmall2').removeClass('dropdown-menu')
} else { } else {
$("#checkIfSmall").addClass("dropdown-menu"); $('#checkIfSmall').addClass('dropdown-menu')
$("#checkIfSmall1").addClass("dropdown-menu"); $('#checkIfSmall1').addClass('dropdown-menu')
$("#checkIfSmall2").addClass("dropdown-menu"); $('#checkIfSmall2').addClass('dropdown-menu')
} }
} }
}); })
var div1 = document.getElementById("toggleImage1"); var div1 = document.getElementById('toggleImage1')
var div2 = document.getElementById("toggleImage2"); var div2 = document.getElementById('toggleImage2')
function switchVisible() { function switchVisible () {
if (!div1) return; if (!div1) return
if (getComputedStyle(div1).display === "inline-block") { if (getComputedStyle(div1).display === 'inline-block') {
div1.style.display = "none"; div1.style.display = 'none'
div2.style.display = "block"; div2.style.display = 'block'
} else { } else {
div1.style.display = "inline-block"; div1.style.display = 'inline-block'
div2.style.display = "none"; div2.style.display = 'none'
} }
} }
document document
.getElementById("toggleButton") .getElementById('toggleButton')
.addEventListener("click", switchVisible); .addEventListener('click', switchVisible)

Loading…
Cancel
Save