let currentPopupSelector = "popup_is-opened";
/**
* Закрытие popup'а.
*/
export function closePopup(currentPopup) {
currentPopup.removeEventListener("mousedown", handleClickOverlay);
document.removeEventListener("keydown", handleKeyDownEsc);
currentPopup
.querySelector(".popup__close")
.removeEventListener("click", closePopup);
currentPopup.classList.remove(currentPopupSelector);
}
export function handleClickOverlay(event) {
if (event.target.classList.contains(currentPopupSelector)) {
closePopup(event);
}
}