PageSourceSearch

https://www.codio.com/hubfs/hub_generated/template_assets/1/205969…/template_dropdown-menu.min.js

js codio.com collected 2026-09-24 19:46:01 UTC 2,273 bytes, 2 lines download raw bytes

1const KEYS={ESCAPE:"Escape",ARROW_DOWN:"ArrowDown"};class HsDropdownMenu{DROPDOWN_MENU_BUTTON_SELECTOR=".dropdown-menu__button";DROPDOWN_MENU_CONTENT_SELECTOR=".dropdown-menu__content";OPEN_CLASS="--open";VISIBLE_CLASS="visible";constructor(dropdownMenu){this.dropdownMenu=dropdownMenu,this.button=dropdownMenu.querySelector(this.DROPDOWN_MENU_BUTTON_SELECTOR),this.content=dropdownMenu.querySelector(this.DROPDOWN_MENU_CONTENT_SELECTOR),this.init()}init(){this.button&&this.content&&(this.button.addEventListener("click",e=>{e.preventDefault(),this.toggleMenu()}),this.button.addEventListener("keydown",e=>{e.key===KEYS.ESCAPE?this.closeMenu():e.key===KEYS.ARROW_DOWN&&(e.preventDefault(),this.dropdownMenu.classList.contains(this.OPEN_CLASS)||this.openMenu())}),document.addEventListener("click",e=>{this.dropdownMenu.contains(e.target)||this.closeMenu()}),window.addEventListener("resize",()=>{this.closeMenu()}))}updateMenuPosition(){if(!window.FloatingUIDOM)return;const{computePosition:computePosition,offset:offset,flip:flip,shift:shift}=window.FloatingUIDOM,alignment=this.content.dataset.alignment;computePosition(this.button,this.content,{placement:alignment??"bottom-start",strategy:"fixed",middleware:[offset(6),flip({fallbackPlacements:["bottom-start","top-end","top-start"]}),shift({padding:5})]}).then(({x:x,y:y})=>{Object.assign(this.content.style,{opacity:1,transform:"translate3D(0, 0, 0)",left:`${x}px`,top:`${y}px`})})}openMenu(){this.dropdownMenu.classList.add(this.OPEN_CLASS),this.content.classList.add(this.VISIBLE_CLASS),this.button.setAttribute("aria-expanded","true"),this.updateMenuPosition()}closeMenu(){this.dropdownMenu.classList.remove(this.OPEN_CLASS),this.content.style.opacity=0,this.content.style.transform="",this.content.classList.remove(this.VISIBLE_CLASS),this.button.setAttribute("aria-expanded","false")}toggleMenu(){this.dropdownMenu.classList.contains(this.OPEN_CLASS)?this.closeMenu():this.openMenu()}}document.addEventListener("DOMContentLoaded",()=>{Array.from(document.querySelectorAll(".dropdown-menu")).forEach(dropdownMenu=>{new HsDropdownMenu(dropdownMenu)})});
2//# sourceURL=https://2227229.fs1.hubspotusercontent-na1.net/hubfs/2227229/hub_generated/template_assets/1/205969181328/1789589198971/template_dropdown-menu.js

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.