{"version":3,"file":"department-menu.js","mappings":"gzBAAA,IAKMA,EAAc,WAClB,SAAAA,IAAc,I,MAAAC,EAAA,M,4FAAAC,CAAA,KAAAF,G,EAAA,K,EAUO,WAEnB,IAGMG,EAHiBF,EAAKG,eAAeC,gBAAgB,GAGhCC,QAAQH,IAE/BA,IAEFI,OAAOC,SAASC,KAAON,EAE3B,G,MArBc,yB,wFACZO,KAAKN,eAAiBO,SAASC,cAAc,wBAE7CF,KAAKG,YACP,C,QAIC,O,EAJAb,G,EAAA,EAAAc,IAAA,aAAAC,MAED,WAAa,IAAAC,EAAA,KACXN,KAAKN,eAAea,iBAAiB,UAAU,kBAAMD,EAAKE,oBAAoB,GAChF,M,oEAAClB,CAAA,CATiB,GAyBpB,W","sources":["webpack://cornell-engineering/./static/js/components/department-menu.js"],"sourcesContent":["/**\n * DepartmentMenu\n *\n * Add behaviors to toggle the primary navigation dropdowns\n */\nclass DepartmentMenu {\n constructor() {\n this.departmentMenu = document.querySelector('.js--department-menu');\n\n this.bindEvents();\n }\n\n bindEvents() {\n this.departmentMenu.addEventListener('change', () => this.onMenuOptionChange());\n }\n\n onMenuOptionChange = () => {\n // Get the selected option\n const selectedOption = this.departmentMenu.selectedOptions[0];\n\n // Get the URL from the data attribute of the selected option\n const url = selectedOption.dataset.url;\n\n if (url) {\n // Redirect to the URL\n window.location.href = url;\n }\n };\n}\n\nexport default DepartmentMenu;\n"],"names":["DepartmentMenu","_this","_classCallCheck","url","departmentMenu","selectedOptions","dataset","window","location","href","this","document","querySelector","bindEvents","key","value","_this2","addEventListener","onMenuOptionChange"],"sourceRoot":""}