{"version":3,"sources":["webpack:///./widgets/navigator.js"],"names":["WG","Navigator","$el","_classCallCheck","this","key","value","setNavigator","handleOnHover","_this2","$","window","scroll","e","wg","currentY","scrollTop","maxY","document","body","scrollHeight","utils","checkBP","removeClass","hasClass","addClass","_this","hover","$nav","doShow","concat","showPreview","find","on","currentTarget"],"mappings":"y2BACA,IAEMA,EAAK,cASEC,EAAS,WAKpB,O,EAHD,SAAAA,EAAYC,I,4FAAKC,CAAA,KAAAF,GAEhBG,KAAKF,IAAMA,I,EACX,EAAAG,IAAA,OAAAC,MAED,WACCF,KAAKG,eACLH,KAAKI,kBACL,CAAAH,IAAA,eAAAC,MAED,WAAe,IAAAG,EAAA,KACdC,EAAEC,QAAQC,QAAO,SAAAC,GACb,IAAIC,EAAKJ,EAAED,EAAKP,KACZa,EAAWL,EAAEC,QAAQK,YACxBC,EAAOC,SAASC,KAAKC,aAGrBC,IAAMC,QAAQ,MAKjBR,EAAGS,YAAY,YAJZR,GAAYE,EAAO,IAAMH,EAAGU,SAAS,YAAYV,EAAGW,SAAS,WAE1DV,EAAWE,EAAO,GAAKH,EAAGU,SAAS,YAAYV,EAAGS,YAAY,iBAMtE,CAAAlB,IAAA,gBAAAC,MAED,WACC,IAAIoB,EAAQtB,KACRF,EAAMQ,EAAEgB,EAAMxB,KAEdyB,EAAQ,SAACC,EAAMC,GACLD,EAAKJ,SAAS,GAADM,OA7CjB,YA6CwB,UAErBJ,EAAMK,YAAY7B,EAAI8B,KAAK,GAADF,OAAI9B,EAAE,gBAAgB6B,GACrDH,EAAMK,YAAY7B,EAAI8B,KAAK,GAADF,OAAI9B,EAAE,iBAAiB6B,IAGzD3B,EAAI8B,KAAK,GAADF,OAAI9B,EAAE,QAAOiC,GAAG,cAAc,SAACpB,GACtCc,EAAMjB,EAAEG,EAAEqB,gBAAgB,MAG3BhC,EAAI8B,KAAK,GAADF,OAAI9B,EAAE,QAAOiC,GAAG,cAAc,SAACpB,GACtCc,EAAMjB,EAAEG,EAAEqB,gBAAgB,QAE3B,CAAA7B,IAAA,cAAAC,MAED,SAAYsB,EAAMC,GACdA,EAAQD,EAAKH,SAAS,WACpBG,EAAKL,YAAY,gB,0FApDF,I","file":"48.js","sourcesContent":["// CONSTANTS are all caps.\nconst NS = \"Navigator\";\nconst CLS = \"navigator\";\nconst WG = \".\" + CLS + \"-\";\n\n// Import stuff here if you need to or even better to import them dynamically\n// for ex. of dynamic import check out src/scripts/loadWg/navigator.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\n\nimport utils from '../utils';\n\n\nexport class Navigator {\n\n\tconstructor($el) {\n\t\t// $el is the widget node return by the loadNavigator function\n\t\tthis.$el = $el;\n\t}\n\n\tinit() {\n\t\tthis.setNavigator();\n\t\tthis.handleOnHover();\n\t}\n\n\tsetNavigator() {\n\t\t$(window).scroll(e => {\n\t\t let wg = $(this.$el);\n\t\t let currentY = $(window).scrollTop();\n\t\t\tlet maxY = document.body.scrollHeight;\n\n\t\t\t//hide navigator on mobile\n\t\t\tif(!utils.checkBP('ds')) {\n\t\t\t\tif(currentY >= maxY / 3 && !wg.hasClass('is-open')) wg.addClass('is-open');\n\n\t\t \tif(currentY < maxY / 3 && wg.hasClass('is-open')) wg.removeClass('is-open');\n\t\t\t} else {\n\t\t\t\twg.removeClass('is-open');\n\t\t\t}\n\n });\n\t}\n\n\thandleOnHover() {\n\t\tlet _this = this;\n\t\tvar $el = $(_this.$el);\n\n\t\tlet hover = ($nav, doShow) => {\n\t\t\tlet isLeft = $nav.hasClass(`${CLS}-left`);\n\n\t\t\tif (isLeft) _this.showPreview($el.find(`${WG}previewLeft`), doShow);\n\t\t\telse \t\t_this.showPreview($el.find(`${WG}previewRight`), doShow);\n\t\t};\n\n\t\t$el.find(`${WG}nav`).on('mouseenter', (e) => {\n\t\t\thover($(e.currentTarget), true);\n\t\t});\n\n\t\t$el.find(`${WG}nav`).on('mouseleave', (e) => {\n\t\t\thover($(e.currentTarget), false);\n\t\t});\n\t}\n\n\tshowPreview($nav, doShow) {\n\t\tif(doShow) $nav.addClass('is-open');\n\t\telse $nav.removeClass('is-open');\n\t}\n}\n"],"sourceRoot":""}