$(document).ready(function () { //var observer = new ResizeObserver(entries => { // for (var entry of entries) { // if (entry.contentRect.height == 0) { // $("#info .button.filter").attr("aria-expanded", false); // } // else { // $("#info .button.filter").attr("aria-expanded", true); // } // } //}) //observer.observe($("#options")[0]) $(this).on("keyup", "#options .dropdown .option", function (event) { if (event.which == 27) { $(this).parent().hide(); $("#calendar .month.found").first().focus(); } }); $("#dateFilter").click(function () { if ($(this).attr("aria-expanded") == "true") { $(this).attr("aria-expanded", false) } else { $(this).attr("aria-expanded", true) } }); $("#mainContent").click(function () { if ($(this).attr("aria-expanded") == "true") { $(this).attr("aria-expanded", false) } else { $(this).attr("aria-expanded", true) } }); }); window.addEventListener("resize", function (event) { if (screen.width < 859) { $("#mainContent").attr("aria-expanded", false); } }, true);