(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 30 || cpos < this.resetBottomEdge * 2)) { // reset header position to absolute scrolling down this.singleRowReset('slow'); } else if (this.direction === 'up' && (this.startScrollingUp - cpos > 30 || cpos < this.resetBottomEdge * 2)) { // scrolling up - show header this.singleRowStick(); } } else if (document.body.classList.contains('no-sticky-header-animation')) { // the header should always be in its "scrolled up" state Object.assign(this.el.hbox.style, { position: 'fixed', top: v.admin_bar_fix + 'px', transform: '' }); this.el.hbox.classList.toggle('sticky-header-state-stuck', cpos > 0); this.el.hbox.classList.toggle('sticky-header-state-reset', cpos <= 0); } } else { this.el.hbox.classList.toggle('sticky-header-state-stuck', cpos > 0); this.el.hbox.classList.toggle('sticky-header-state-reset', cpos <= 0); } document.body.classList.toggle('vamtam-scrolled', cpos > 0); }; StickyHeader.prototype.singleRowReset = function (speed) { speed = speed || 'fast'; if (!this.active || this.singleRowResetStarted) { return; } this.singleRowResetStarted = true; var true_reset = function () { vamtamgs.TweenLite.set(this.el.hbox, { position: 'absolute', y: 0, x: this.hboxLeft }); this.el.hbox.classList.add('sticky-header-state-reset'); this.el.hbox.classList.remove('sticky-header-state-stuck'); this.singleRowResetStarted = false; }.bind(this); window.vamtam_greensock_wait(function () { vamtamgs.TweenLite.killTweensOf(this.el.hbox); if (speed === 'fast') { true_reset(); } else if (speed === 'slow') { vamtamgs.TweenLite.to(this.el.hbox, 0.15, { y: -this.hboxHeight, ease: vamtamgs.Power4.easeOut, onComplete: true_reset }); } }.bind(this)); }; StickyHeader.prototype.singleRowStick = function () { // it is possible that singleRowStick may be called during a "reset" // make sure to only stick the header if this.singleRowResetStarted === false if (!this.active || this.el.hbox.classList.contains('sticky-header-state-stuck') || this.singleRowResetStarted) { return; } this.el.hbox.classList.add('sticky-header-state-stuck'); this.el.hbox.classList.remove('sticky-header-state-reset'); window.vamtam_greensock_wait(function () { vamtamgs.TweenLite.killTweensOf(this.el.hbox); vamtamgs.TweenLite.fromTo(this.el.hbox, 0.2, { position: 'fixed', top: v.admin_bar_fix, y: -this.hboxHeight, x: this.hboxOffset.left }, { y: -this.topNavHeight - (this.layout === 'double' ? this.logoWrapperHeight : 0), ease: vamtamgs.Power4.easeOut }); }.bind(this)); }; document.addEventListener('DOMContentLoaded', function () { v.stickyHeader = new StickyHeader(); vamtam_greensock_wait(function () { v.addScrollHandler(v.stickyHeader); }); }); })(window.VAMTAM); },{}]},{},[1]);