{"version":3,"file":"./../js/anchor.js","mappings":"CAAA,SAAWA,EAAGC,EAAQC,GA4BpB,SAASC,EAAaC,GAEpB,IACIC,GADAA,EAAcL,EAAEI,GAAME,SAASC,KAOrC,WACE,IAAIC,EAAgBR,EAAE,gBAAgBS,cACtCD,OAA4C,IAAnBA,EAAkCA,EAAgB,EAC3E,IAAIE,EAAoBV,EAAE,6DAA6DS,cAGvF,OAFAC,OAAoD,IAAvBA,EAAsCA,EAAoB,EACpEV,EAAE,WAAWS,cACVD,EAAgBE,CACxC,CAbkCC,GAChCX,EAAE,cAAcY,QAAQ,CACtBC,UAAWR,GACV,KAAK,WAAa,GACvB,CAjCAJ,EAAOa,UAAUC,gBAAkB,CACjCC,OAAQ,SAAUC,GAChBjB,EAAE,oEAAqEiB,GAASC,GAAG,SAAS,SAAUC,GAClF,KAAdC,KAAKhB,MAA6B,MAAdgB,KAAKhB,OAC3Be,EAAME,iBAGNlB,EAFWiB,KAAKhB,MAIpB,IAGIF,EAAOoB,SAASlB,OAClBmB,OAAO,EAAG,GAEVC,YAAW,WAAcD,OAAO,EAAG,EAAI,GAAG,GAC1CvB,GAAE,WACIE,EAAOoB,SAASlB,OAClBqB,QAAQC,IAAIxB,EAAOoB,SAASlB,MAC5BD,EAAaD,EAAOoB,SAASlB,MAEjC,IAEJ,EAqBH,CA9CD,CA8CGuB,OAAQ1B,OAAQC","sources":["webpack://kelty_redesign/./templates/components/anchor/anchor.js"],"sourcesContent":["(function ($, Drupal, window) {\n\n Drupal.behaviors.anchorsScrollTo = {\n attach: function (context) {\n $('a[href^=\"#\"]:not([data-toggle=\"tab\"]):not(.entity-browser-iframe)', context).on('click', function (event) {\n if (this.hash !== \"\" && this.hash !== \"#\") {\n event.preventDefault();\n var hash = this.hash;\n\n siteScrollTo(hash);\n }\n });\n\n // For when loading a page with anchor.\n if (window.location.hash) {\n scroll(0, 0);\n // void some browsers issue\n setTimeout(function () { scroll(0, 0); }, 1);\n $(function () {\n if (window.location.hash) {\n console.log(window.location.hash);\n siteScrollTo(window.location.hash);\n }\n });\n }\n }\n };\n\n function siteScrollTo(hash) {\n // Support for Drupal admin toolbar.\n var positionTop = $(hash).offset().top;\n var positionTop = positionTop - getFullHeaderHeight();\n $('html, body').animate({\n scrollTop: positionTop\n }, 800, function () {});\n }\n\n function getFullHeaderHeight() {\n var toolbarHeight = $('#toolbar-bar').outerHeight();\n toolbarHeight = (typeof (toolbarHeight) !== 'undefined') ? toolbarHeight : 0;\n var toolbarTrayHeight = $('#toolbar-item-administration-tray.toolbar-tray-horizontal').outerHeight();\n toolbarTrayHeight = (typeof (toolbarTrayHeight) !== 'undefined') ? toolbarTrayHeight : 0;\n var headerHeight = $('#header').outerHeight();\n return headerHeight + toolbarHeight + toolbarTrayHeight;\n }\n\n})(jQuery, Drupal, window);\n"],"names":["$","Drupal","window","siteScrollTo","hash","positionTop","offset","top","toolbarHeight","outerHeight","toolbarTrayHeight","getFullHeaderHeight","animate","scrollTop","behaviors","anchorsScrollTo","attach","context","on","event","this","preventDefault","location","scroll","setTimeout","console","log","jQuery"],"sourceRoot":""}