{"version":3,"sources":["webpack://[name]/./src/js/components/ViewAllComponent.js"],"names":["ViewAllComponent","_BaseComponent","props","_this","_classCallCheck","_callSuper","viewAllContent","onResizeWindow","_inherits","_createClass","key","get","triggers","content","value","large","window","matchMedia","wrapper","this","$el","previousElementSibling","itemList","querySelectorAll","style","height","wrapperH","offsetHeight","matches","length","classList","add","addEventListener","event","preventDefault","_this2","e","BaseComponent"],"mappings":"keAAuD,IAElCA,EAAgB,SAAAC,GAOnC,SAAAD,EAAYE,GAAO,IAAAC,EAGK,OAHLC,IAAA,KAAAJ,IACjBG,EAAAE,EAAA,KAAAL,EAAA,CAAME,KACDI,iBACLH,EAAKI,iBAAiBJ,EACvB,OAAAK,IAAAR,EAAAC,GAAAQ,IAAAT,EAAA,EAAAU,IAAA,YAAAC,IAVD,WACE,MAAO,CACLC,SAAU,eACVC,QAAS,2BAEZ,CAAAH,IAAA,iBAAAI,MAOD,WACE,IAAMC,EAAQC,OAAOC,WAAW,uBAC1BC,EAAUC,KAAKC,IAAIC,uBACnBC,EAAWJ,EAAQK,iBAAiB,cAC1CL,EAAQM,MAAMC,OAAS,OACvB,IAAMC,EAAWR,EAAQS,cAEpBZ,EAAMa,SAAWN,EAASO,QAAU,EACvCV,KAAKC,IAAIU,UAAUC,IAAI,SAIzBb,EAAQM,MAAMC,OAAUC,EAAW,EAAMA,EAAW,EAAK,KAEzDP,KAAKC,IAAIY,iBAAiB,SAAS,SAAUC,GAC3CA,EAAMC,iBACNhB,EAAQM,MAAMC,OAAS,OACvBN,KAAKW,UAAUC,IAAI,cAEtB,CAAArB,IAAA,iBAAAI,MAED,WAAiB,IAAAqB,EAAA,KACfnB,OAAOgB,iBAAiB,UAAU,SAACI,GACjCD,EAAK7B,wBApC0B,C,OAAS+B","file":"js/component-ViewAllComponent-js.chunks.js","sourcesContent":["import BaseComponent from '../abstracts/BaseComponent';\n\nexport default class ViewAllComponent extends BaseComponent {\n  get SELECTORS() {\n    return {\n      triggers: '.js-view-all',\n      content: '.js-accordion-content'\n    };\n  }\n  constructor(props) {\n    super(props);\n    this.viewAllContent();\n    this.onResizeWindow();\n  }\n\n  viewAllContent() {\n    const large = window.matchMedia(\"(min-width: 1024px)\");\n    const wrapper = this.$el.previousElementSibling;\n    const itemList = wrapper.querySelectorAll('.news-item')\n    wrapper.style.height = 'auto';\n    const wrapperH = wrapper.offsetHeight;\n\n    if (!large.matches || itemList.length <= 6) {\n      this.$el.classList.add('hide');\n      return;\n    }\n\n    wrapper.style.height = (wrapperH / 2) + (wrapperH / 4) + 'px';\n\n    this.$el.addEventListener(\"click\", function (event) {\n      event.preventDefault();\n      wrapper.style.height = 'auto';\n      this.classList.add('hide');\n    });\n  }\n\n  onResizeWindow() {\n    window.addEventListener('resize', (e) => {\n      this.viewAllContent();\n    })\n  }\n}"],"sourceRoot":""}