Files
egbim_homepage/egbim/skin/sales/assets/js/common.min.js
T
2026-07-23 16:15:57 +09:00

1 line
1.4 KiB
JavaScript

"use strict";var scrollY,wrap,MOBILE_BREAKPOINT=1025;function syncHeight(){document.documentElement.style.setProperty("--window-inner-height","".concat(window.innerHeight,"px"))}function isMobile(){return window.innerWidth<MOBILE_BREAKPOINT}function bodyLock(){wrap?(scrollY=window.scrollY,document.documentElement.classList.add("is-locked"),document.documentElement.style.scrollBehavior="auto",wrap.style.top="-".concat(scrollY,"px")):console.warn("wrap element not found")}function bodyUnlock(){document.documentElement.classList.remove("is-locked"),void 0!==scrollY&&window.scrollTo(0,scrollY),wrap&&(wrap.style.top=""),document.documentElement.style.scrollBehavior=""}function popOpen(e){document.getElementById(e)?($("#"+e).fadeIn("fast"),bodyLock()):console.warn('Popup with id "'.concat(e,'" not found'))}function popClose(e){$(e).parents(".popup").fadeOut("fast"),bodyUnlock()}document.addEventListener("DOMContentLoaded",function(){(wrap=document.querySelector(".wrap"))?syncHeight():console.error("Wrap element not found")}),window.addEventListener("resize",function(){syncHeight()});var rootStyle=getComputedStyle(document.documentElement);function cssVar(e){return rootStyle.getPropertyValue(e).trim()}function fullScreen(){document.fullscreenElement?document.exitFullscreen().catch(function(e){console.log("전체화면 종료 실패:",e)}):document.documentElement.requestFullscreen().catch(function(e){console.log("전체화면 전환 실패:",e)})}