1 2/** 3 stickybits - Stickybits is a lightweight alternative to `position: sticky` polyfills 4 @version v3.6.1 5 @link https://github.com/dollarshaveclub/stickybits#readme 6 @author Jeff Wainwright <[email protected]> (https://jeffry.in) 7 @license MIT 8**/ 9(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=global||self,global.stickybits=factory())}(this,function(){'use strict';var Stickybits=function(){function Stickybits(target,obj){var o=typeof obj!=='undefined'?obj:{};this.version='3.6.1';this.userAgent=window.navigator.userAgent||'no `userAgent` provided by the browser';this.props={customStickyChangeNumber:o.customStickyChangeNumber||null,noStyles:o.noStyles||!1,stickyBitStickyOffset:o.stickyBitStickyOffset||0,parentClass:o.parentClass||'js-stickybit-parent',scrollEl:typeof o.scrollEl==='string'?document.querySelector(o.scrollEl):o.scrollEl||window,stickyClass:o.stickyClass||'js-is-sticky',stuckClass:o.stuckClass||'js-is-stuck',stickyChangeClass:o.stickyChangeClass||'js-is-sticky--change',useStickyClasses:o.useStickyClasses||!1,useFixed:o.useFixed||!1,useGetBoundingClientRect:o.useGetBoundingClientRect||!1,verticalPosition:o.verticalPosition||'top'};this.props.positionVal=this.definePosition()||'fixed';this.instances=[];var _this$props=this.props,positionVal=_this$props.positionVal,verticalPosition=_this$props.verticalPosition,noStyles=_this$props.noStyles,stickyBitStickyOffset=_this$props.stickyBitStickyOffset,useStickyClasses=_this$props.useStickyClasses;var verticalPositionStyle=verticalPosition==='top'&&!noStyles?stickyBitStickyOffset+"px":'';var positionStyle=positionVal!=='fixed'?positionVal:'';this.els=typeof target==='string'?document.querySelectorAll(target):target;if(!('length' in this.els))this.els=[this.els];for(var i=0;i<this.els.length;i++){var el=this.els[i];el.style[verticalPosition]=verticalPositionStyle;el.style.position=positionStyle;if(positionVal==='fixed'||useStickyClasses){var instance=this.addInstance(el,this.props);this.instances.push(instance)}}} 10var _proto=Stickybits.prototype;_proto.definePosition=function definePosition(){var stickyProp;if(this.props.useFixed){stickyProp='fixed'}else{var prefix=['','-o-','-webkit-','-moz-','-ms-'];var test=document.head.style;for(var i=0;i<prefix.length;i+=1){test.position=prefix[i]+"sticky"} 11stickyProp=test.position?test.position:'fixed';test.position=''} 12return stickyProp};_proto.addInstance=function addInstance(el,props){var _this=this;var item={el:el,parent:el.parentNode,props:props};this.isWin=this.props.scrollEl===window;var se=this.isWin?window:this.getClosestParent(item.el,item.props.scrollEl);this.computeScrollOffsets(item);item.parent.className+=" "+props.parentClass;item.state='default';item.stateContainer=function(){return _this.manageState(item)};se.addEventListener('scroll',item.stateContainer);return item};_proto.getClosestParent=function getClosestParent(el,match){var p=match;var e=el;if(e.parentElement===p)return p;while(e.parentElement!==p){e=e.parentElement} 13return p};_proto.getTopPosition=function getTopPosition(el){if(this.props.useGetBoundingClientRect){return el.getBoundingClientRect().top+(this.props.scrollEl.pageYOffset||document.documentElement.scrollTop)} 14var topPosition=0;do{topPosition=el.offsetTop+topPosition}while(el=el.offsetParent);return topPosition};_proto.computeScrollOffsets=function computeScrollOffsets(item){var it=item;var p=it.props;var el=it.el;var parent=it.parent;var isCustom=!this.isWin&&p.positionVal==='fixed';var isTop=p.verticalPosition!=='bottom';var scrollElOffset=isCustom?this.getTopPosition(p.scrollEl):0;var stickyStart=isCustom?this.getTopPosition(parent)-scrollElOffset:this.getTopPosition(parent);var stickyChangeOffset=p.customStickyChangeNumber!==null?p.customStickyChangeNumber:el.offsetHeight;var parentBottom=stickyStart+parent.offsetHeight;it.offset=scrollElOffset+p.stickyBitStickyOffset;it.stickyStart=isTop?stickyStart-it.offset:0;it.stickyChange=it.stickyStart+stickyChangeOffset;it.stickyStop=isTop?parentBottom-(el.offsetHeight+it.offset):parentBottom-window.innerHeight;return it};_proto.toggleClasses=function toggleClasses(el,r,a){var e=el;var cArray=e.className.split(' ');
14if(a&&cArray.indexOf(a)===-1)cArray.push(a);var rItem=cArray.indexOf(r);if(rItem!==-1)cArray.splice(rItem,1);e.className=cArray.join(' ')};_proto.manageState=function manageState(item){var it=item;var e=it.el;var p=it.props;var state=it.state;var start=it.stickyStart;var change=it.stickyChange;var stop=it.stickyStop;var stl=e.style;var ns=p.noStyles;var pv=p.positionVal;var se=p.scrollEl;var sticky=p.stickyClass;var stickyChange=p.stickyChangeClass;var stuck=p.stuckClass;var vp=p.verticalPosition;var isTop=vp!=='bottom';var rAFStub=function rAFDummy(f){f()};var rAF=!this.isWin?rAFStub:window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||rAFStub;var tC=this.toggleClasses;var scroll=this.isWin?window.scrollY||window.pageYOffset:se.scrollTop;var notSticky=scroll>start&&scroll<stop&&(state==='default'||state==='stuck');var isSticky=isTop&&scroll<=start&&(state==='sticky'||state==='stuck');var isStuck=scroll>=stop&&state==='sticky';if(notSticky){it.state='sticky';rAF(function(){tC(e,stuck,sticky);stl.position=pv;if(ns)return;stl.bottom='';stl[vp]=p.stickyBitStickyOffset+"px"})}else if(isSticky){it.state='default';rAF(function(){tC(e,sticky);tC(e,stuck);if(pv==='fixed')stl.position=''})}else if(isStuck){it.state='stuck';rAF(function(){tC(e,sticky,stuck);if(pv!=='fixed'||ns)return;stl.top='';stl.bottom='0';stl.position='absolute'})} 15var isStickyChange=scroll>=change&&scroll<=stop;var isNotStickyChange=scroll<change/2||scroll>stop;var stub='stub';if(isNotStickyChange){rAF(function(){tC(e,stickyChange)})}else if(isStickyChange){rAF(function(){tC(e,stub,stickyChange)})} 16return it};_proto.update=function update(updatedProps){if(updatedProps===void 0){updatedProps=null} 17for(var i=0;i<this.instances.length;i+=1){var instance=this.instances[i];this.computeScrollOffsets(instance);if(updatedProps){for(var updatedProp in updatedProps){instance.props[updatedProp]=updatedProps[updatedProp]}}} 18return this};_proto.removeInstance=function removeInstance(instance){var e=instance.el;var p=instance.props;var tC=this.toggleClasses;e.style.position='';e.style[p.verticalPosition]='';tC(e,p.stickyClass);tC(e,p.stuckClass);tC(e.parentNode,p.parentClass)};_proto.cleanup=function cleanup(){for(var i=0;i<this.instances.length;i+=1){var instance=this.instances[i];instance.props.scrollEl.removeEventListener('scroll',instance.stateContainer);this.removeInstance(instance)} 19this.manageState=!1;this.instances=[]};return Stickybits}();function stickybits(target,o){return new Stickybits(target,o)} 20return stickybits}));var stickyScreenSize;var stickybit=[];jQuery(function(){if(!jQuery('body').hasClass('fl-builder-edit')&&jQuery("[bt-sticky='true'], [bt-sticky='large'],[bt-sticky='large-med'],[bt-sticky='med'],[bt-sticky='med-small'],[bt-sticky='small']").length){console.log('sticky init render');renderStickyStuff();jQuery(window).resize(function(){if(whatSizeScreen(window.innerWidth)==stickyScreenSize){return}else{jQuery.each(stickybit,function(index,sticker){sticker.cleanup()});renderStickyStuff()}})}});
20function renderStickyStuff(){stickyScreenSize=whatSizeScreen(window.innerWidth);var stickyItems=jQuery("[bt-sticky]");if(stickyItems.length!==0){jQuery('[bt-sticky]').parents().each(function(){if(jQuery(this).css("overflow")!="visible"){console.log("Sticky Column Notice: CSS Sticky position requires all parent elements to have overflow:visible. We detected one below that does not have that setting. Not to worry, we have updated them automatically.");console.log(jQuery(this));console.log("overflow: "+jQuery(this).css('overflow')+", changed to... overflow:visible");jQuery(this).css("overflow","visible")}});stickyItems.each(function(index,item){var topPadding=parseInt(jQuery(item).attr('bt-sticky-offset'));var stickyItem=jQuery(item);var stickyPosition=stickyItem.attr('bt-sticky-position');var stickyVal=stickyItem.attr('bt-sticky');var stickyToBody=stickyItem.attr('bt-sticky-to-body');if(window.innerWidth<FLBuilderLayoutConfig.breakpoints.small){if(stickyItem.hasClass('no-stick-mobile')||stickyItem.hasClass('no-stick-small')) 21return;if(stickyVal=='large'||stickyVal=='large-med'||stickyVal=='med') 22return} 23if((window.innerWidth>FLBuilderLayoutConfig.breakpoints.small)&&(window.innerWidth<FLBuilderLayoutConfig.breakpoints.medium)){if(stickyItem.hasClass('no-stick-tablet')||stickyItem.hasClass('no-stick-medium')) 24return;if(stickyVal=='large'||stickyVal=='small') 25return} 26if((window.innerWidth>FLBuilderLayoutConfig.breakpoints.medium)){if(stickyItem.hasClass('no-stick-desktop')||stickyItem.hasClass('no-stick-large')) 27return;if(stickyVal=='med'||stickyVal=='med-small'||stickyVal=='small') 28return} 29if(stickyItem.parent().hasClass('fl-col-group-nested')) 30stickyItem=stickyItem.parent();if(typeof stickyToBody!=="undefined"&&stickyToBody!==''&&stickyToBody!=='inline'&&!stickyItem.hasClass('stickymoved')){if(stickyToBody=='before-header') 31jQuery('header').first().before(stickyItem.detach());if(stickyToBody=='before-footer') 32jQuery('footer').first().before(stickyItem.detach());if(stickyToBody=='after-header') 33jQuery('header').first().after(stickyItem.detach());if(stickyToBody=='after-footer') 34jQuery('footer').first().after(stickyItem.detach());stickyItem.addClass('stickmoved').addClass('fl-builder-content');console.log('moved to body: '+stickyToBody)} 35stickybit.push(stickybits(stickyItem,{stickyBitStickyOffset:topPadding,useStickyClasses:!0,stickyClass:'bt-sticking',stuckClass:'bt-stuck',verticalPosition:stickyPosition,}));if(stickyPosition=='bottom') 36if(stickyToBody=='inline'||stickyToBody=='before-footer'||stickyToBody=='after-footer') 37jQuery(window).scrollTop(jQuery(window).scrollTop()+1);})}} 38function whatSizeScreen(size){if(!size) 39return!1;if(size<FLBuilderLayoutConfig.breakpoints.small) 40return'small';if(size>FLBuilderLayoutConfig.breakpoints.medium) 41return'large';return'medium'}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.