{"version":3,"file":"js/701.8e03ce9d8ca5ea5fae6d.js","mappings":"s4BA6DA,QAxDkB,WAWb,O,EAVD,SAAAA,K,4FAAcC,CAAA,KAAAD,GACVE,KAAKC,OAASC,IAAE,mCAAmCC,OAAO,UAC1DH,KAAKI,SAAW,KAChBJ,KAAKK,YAAc,KACnBL,KAAKM,OAAS,GAEdJ,IAAEK,QAAQC,GAAG,SAAUR,KAAKS,aAAaC,KAAKV,OAC9CE,IAAEK,QAAQC,GAAG,SAAUR,KAAKS,aAAaC,KAAKV,OAE9CA,KAAKS,cACT,G,EAAC,EAAAE,IAAA,iBAAAC,MAED,WACIZ,KAAKC,OAAOY,IAAI,CACZ,SAAY,SACZ,IAAO,OACP,MAAS,QAEjB,GAAC,CAAAF,IAAA,wBAAAC,MAED,WACIZ,KAAKc,iBACLd,KAAKI,SAAWJ,KAAKC,OAAOK,SAASS,IACrCf,KAAKK,YAAcH,IAAE,UAAUI,SAASS,IAAM,EAClD,GAAC,CAAAJ,IAAA,0BAAAC,MAED,WACI,IAAII,EAAed,IAAEe,UAAUC,YAE/B,GAAIF,EAAehB,KAAKI,SAAWJ,KAAKM,QAAUJ,IAAEK,QAAQY,QAAU,IAAK,CACvE,IAAIC,EAAepB,KAAKM,OACpBU,EAAehB,KAAKK,YAAcL,KAAKC,OAAOoB,aAAY,KAC1DD,EAAepB,KAAKK,YAAcL,KAAKC,OAAOoB,aAAY,GAAQL,GAGtEhB,KAAKC,OAAOY,IAAI,CACZ,SAAY,QACZ,IAAOO,EAAe,KACtB,MAASpB,KAAKC,OAAOqB,YAAW,IAExC,MACItB,KAAKc,gBAEb,GAAC,CAAAH,IAAA,eAAAC,MAED,WAC+B,IAAvBZ,KAAKC,OAAOsB,SAIhBvB,KAAKwB,wBACLxB,KAAKyB,0BACT,M,yFAAC,CArDa,E","sources":["webpack://sitecore-web-schreuderssport/./scripts/modules/sticky-basket.js"],"sourcesContent":["// Description: Sticky basket module.\r\nimport $ from 'jquery';\r\n\r\n\"use strict\";\r\n\r\nclass StickyBasket {\r\n constructor() {\r\n this.basket = $(\"#pnlProductDetailsBasketProduct\").parent('.panel');\r\n this.topBound = null;\r\n this.bottomBound = null;\r\n this.offset = 70;\r\n\r\n $(window).on('resize', this.adjustBasket.bind(this));\r\n $(window).on('scroll', this.adjustBasket.bind(this));\r\n \r\n this.adjustBasket();\r\n }\r\n\r\n resetBasketCss() {\r\n this.basket.css({\r\n 'position': 'static',\r\n 'top': 'auto',\r\n 'width': 'auto'\r\n });\r\n }\r\n\r\n calculateBasketBounds() {\r\n this.resetBasketCss();\r\n this.topBound = this.basket.offset().top;\r\n this.bottomBound = $('footer').offset().top - 62;\r\n }\r\n\r\n calculateBasketPosition() {\r\n var windowTopPos = $(document).scrollTop();\r\n\r\n if (windowTopPos > this.topBound - this.offset && $(window).width() > 767) {\r\n var basketTopPos = this.offset;\r\n if (windowTopPos > this.bottomBound - this.basket.outerHeight(true)) {\r\n basketTopPos = this.bottomBound - this.basket.outerHeight(true) - windowTopPos;\r\n }\r\n\r\n this.basket.css({\r\n 'position': 'fixed',\r\n 'top': basketTopPos + 'px',\r\n 'width': this.basket.outerWidth(true)\r\n });\r\n } else {\r\n this.resetBasketCss();\r\n }\r\n }\r\n\r\n adjustBasket() {\r\n if (this.basket.length === 0) {\r\n return;\r\n }\r\n\r\n this.calculateBasketBounds();\r\n this.calculateBasketPosition();\r\n }\r\n}\r\n\r\nexport default StickyBasket;\r\n"],"names":["StickyBasket","_classCallCheck","this","basket","$","parent","topBound","bottomBound","offset","window","on","adjustBasket","bind","key","value","css","resetBasketCss","top","windowTopPos","document","scrollTop","width","basketTopPos","outerHeight","outerWidth","length","calculateBasketBounds","calculateBasketPosition"],"sourceRoot":""}