{"version":3,"file":"Diagram.StickyHeader.28b127fe.js","sources":["../src/current/js/modules/Diagram.StickyHeader.js"],"sourcesContent":["export function DisableStickyHeader() {\r\n new CustomEvent('disable-sticky-header');\r\n}\r\n\r\nexport function EnableStickyHeader() {\r\n new CustomEvent('enable-sticky-header');\r\n}\r\n\r\nexport function ShowStickyHeader() {\r\n new CustomEvent('show-sticky-header');\r\n}\r\n\r\nexport function DiagramStickyHeader() {\r\n //$('#container').css('marginTop', $('.js-sticky-header').outerHeight());\r\n\r\n var Diagram = {};\r\n\tDiagram.StickyHeader = [];\r\n Diagram.StickyHeader.$header = $('.js-normal-header');\r\n Diagram.StickyHeader.$navbar = $('.js-sticky-header');\r\n Diagram.StickyHeader.headerHeight = 0;\r\n Diagram.StickyHeader.enabled = true;\r\n\r\n\tDiagram.StickyHeader.showNavBar = function () {\r\n\t\tDiagram.StickyHeader.$header.removeClass('nav-up').addClass('nav-down');\r\n };\r\n\r\n Diagram.StickyHeader.hideNavBar = function () {\r\n Diagram.StickyHeader.$header.removeClass('nav-down').addClass('nav-up');\r\n };\r\n\r\n Diagram.StickyHeader.hasScrolled = function () {\r\n if (Diagram.StickyHeader.enabled) {\r\n var st = $(document).scrollTop();\r\n\r\n // If they scrolled down and are past the navbar, add class .nav-up.\r\n if (st > Diagram.StickyHeader.headerHeight) {\r\n // Scroll Down\r\n Diagram.StickyHeader.hideNavBar();\r\n } else {\r\n // Scroll Up\r\n Diagram.StickyHeader.showNavBar();\r\n }\r\n }\r\n\t}\r\n\r\n\tDiagram.StickyHeader.init = function () {\r\n if (Diagram.StickyHeader.$navbar.length > 0) {\r\n Diagram.StickyHeader.headerHeight = Diagram.StickyHeader.$header.outerHeight();\r\n\r\n $(window).on(\"scroll\", Diagram.StickyHeader.hasScrolled);\r\n\r\n\t\t\tdocument.addEventListener('disable-sticky-header', function () {\r\n\t\t\t\tDiagram.StickyHeader.enabled = false;\r\n\t\t\t});\r\n\r\n\t\t\tdocument.addEventListener('show-sticky-header', function () {\r\n\t\t\t\tDiagram.StickyHeader.showNavBar();\r\n\t\t\t});\r\n\r\n\t\t\tdocument.addEventListener('enable-sticky-header', function () {\r\n\t\t\t\tDiagram.StickyHeader.enabled = true;\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tDiagram.StickyHeader.init();\r\n}"],"names":["DisableStickyHeader","EnableStickyHeader","ShowStickyHeader","DiagramStickyHeader","Diagram","st"],"mappings":"AAAO,SAASA,GAAsB,CAClC,IAAI,YAAY,uBAAuB,CAC3C,CAEO,SAASC,GAAqB,CACjC,IAAI,YAAY,sBAAsB,CAC1C,CAEO,SAASC,GAAmB,CAC/B,IAAI,YAAY,oBAAoB,CACxC,CAEO,SAASC,GAAsB,CAGlC,IAAIC,EAAU,CAAA,EACjBA,EAAQ,aAAe,GACpBA,EAAQ,aAAa,QAAU,EAAE,mBAAmB,EACpDA,EAAQ,aAAa,QAAU,EAAE,mBAAmB,EACpDA,EAAQ,aAAa,aAAe,EACpCA,EAAQ,aAAa,QAAU,GAElCA,EAAQ,aAAa,WAAa,UAAY,CAC7CA,EAAQ,aAAa,QAAQ,YAAY,QAAQ,EAAE,SAAS,UAAU,CACxE,EAEIA,EAAQ,aAAa,WAAa,UAAY,CAC1CA,EAAQ,aAAa,QAAQ,YAAY,UAAU,EAAE,SAAS,QAAQ,CAC9E,EAEIA,EAAQ,aAAa,YAAc,UAAY,CAC3C,GAAIA,EAAQ,aAAa,QAAS,CAC9B,IAAIC,EAAK,EAAE,QAAQ,EAAE,UAAS,EAG1BA,EAAKD,EAAQ,aAAa,aAE1BA,EAAQ,aAAa,aAGrBA,EAAQ,aAAa,YAE5B,CACP,EAEDA,EAAQ,aAAa,KAAO,UAAY,CAC7BA,EAAQ,aAAa,QAAQ,OAAS,IACtCA,EAAQ,aAAa,aAAeA,EAAQ,aAAa,QAAQ,cAEjE,EAAE,MAAM,EAAE,GAAG,SAAUA,EAAQ,aAAa,WAAW,EAEhE,SAAS,iBAAiB,wBAAyB,UAAY,CAC9DA,EAAQ,aAAa,QAAU,EACnC,CAAI,EAED,SAAS,iBAAiB,qBAAsB,UAAY,CAC3DA,EAAQ,aAAa,YACzB,CAAI,EAED,SAAS,iBAAiB,uBAAwB,UAAY,CAC7DA,EAAQ,aAAa,QAAU,EACnC,CAAI,EAEF,EAEDA,EAAQ,aAAa,MACtB"}