{"version":3,"sources":["webpack:///./src/js/modules/fund-masthead.js"],"names":["Module","Component","setupDefaults","this","dom","mastheadFundInfo","el","querySelector","fundMasthead","setMarginBottom","addListeners","window","addEventListener","bind","runAnimations","classList","add","mastheadFundInfoHeight","offsetHeight","widthSize","innerWidth","style","marginBlockEnd"],"mappings":"0FAAA,kBAEA,MAAMA,UAAeC,YACnBC,gBACEC,KAAKC,IAAM,CACTC,iBAAkBF,KAAKG,GAAGC,cAAc,+BACxCC,aAAcL,KAAKG,IAGjBH,KAAKC,IAAIC,kBAAkBF,KAAKM,kBAGtCC,eACEC,OAAOC,iBAAiB,SAAUT,KAAKM,gBAAgBI,KAAKV,OAC5DA,KAAKW,gBAGPA,gBACEX,KAAKG,GAAGS,UAAUC,IAAI,yBAGxBP,kBAEE,MAAMQ,EAAyBd,KAAKC,IAAIC,iBAAiBa,aAAe,IAClEC,EAAYR,OAAOS,WAErBD,EAAY,IACdhB,KAAKC,IAAII,aAAaa,MAAMC,eAAiB,OAI3CH,GAAa,MACfhB,KAAKC,IAAII,aAAaa,MAAMC,eAAoBL,EAAyB,GAA3B,OAOrCjB","file":"24.0a2ab2b947e1fde5e36d.js","sourcesContent":["import { Component } from '@verndale/core';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n mastheadFundInfo: this.el.querySelector('.fund-detail-masthead__info'),\n fundMasthead: this.el\n }\n\n if (this.dom.mastheadFundInfo) this.setMarginBottom();\n }\n\n addListeners() {\n window.addEventListener('resize', this.setMarginBottom.bind(this));\n this.runAnimations();\n }\n\n runAnimations() {\n this.el.classList.add('fund-masthead--loaded');\n }\n\n setMarginBottom() {\n // The height must be the info container height minus the padding bottom of the parent container (desktop: 150px)\n const mastheadFundInfoHeight = this.dom.mastheadFundInfo.offsetHeight - 150;\n const widthSize = window.innerWidth;\n\n if (widthSize < 765) {\n this.dom.fundMasthead.style.marginBlockEnd = '40px';\n return;\n }\n\n if (widthSize >= 765) {\n this.dom.fundMasthead.style.marginBlockEnd = `${mastheadFundInfoHeight + 20}px`;\n return;\n }\n\n }\n}\n\nexport default Module;\n"],"sourceRoot":""}