/**
* angular-strap * @version v2.1.6 - 2015-01-11 * @link http://mgcrea.github.io/angular-strap * @author Olivier Louvignes (olivier@mg-crea.com) * @license MIT License, http://www.opensource.org/licenses/MIT */
“use strict”;angular.module(“mgcrea.ngStrap.affix”,).provider(“$affix”,function(){var t=this.defaults={offsetTop:“auto”};this.$get=[“$window”,“debounce”,“dimensions”,function(e,o,s){function n(n,r){function c(t,e,o){var s=a(),n=l();return $>=s?“top”:null!==t&&s+t<=e.top?“middle”:null!==v&&e.top+o+g>=n-v?“bottom”:“middle”}function a(){return h===e?e.pageYOffset:h.scrollTop}function l(){return h===e?e.document.body.scrollHeight:h.scrollHeight}var u={},p=angular.extend({},t,r),h=p.target,d=“affix affix-top affix-bottom”,m=!1,g=0,P=0,$=0,v=0,T=null,x=null,b=n.parent();if(p.offsetParent)if(p.offsetParent.match(/^d+$/))for(var k=0;k<1*p.offsetParent-1;k++)b=b.parent();else b=angular.element(p.offsetParent);return u.init=function(){this.$parseOffsets(),P=s.offset(n).top+g,m=!n.style.width,h.on(“scroll”,this.checkPosition),h.on(“click”,this.checkPositionWithEventLoop),i.on(“resize”,this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},u.destroy=function(){h.off(“scroll”,this.checkPosition),h.off(“click”,this.checkPositionWithEventLoop),i.off(“resize”,this.$debouncedOnResize)},u.checkPositionWithEventLoop=function(){setTimeout(u.checkPosition,1)},u.checkPosition=function(){var t=a(),e=s.offset(n),o=s.height(n),i=c(x,e,o);T!==i&&(T=i,n.removeClass(d).addClass(“affix”+(“middle”!==i?“-”+i:“”)),“top”===i?(x=null,n.css(“position”,p.offsetParent?“”:“relative”),m&&n.css(“width”,“”),n.css(“top”,“”)):“bottom”===i?(x=p.offsetUnpin?-(1*p.offsetUnpin):e.top-t,m&&n.css(“width”,“”),n.css(“position”,p.offsetParent?“”:“relative”),n.css(“top”,p.offsetParent?“”:f.offsetHeight-v-o-P+“px”)):(x=null,m&&n.css(“width”,n.offsetWidth+“px”),n.css(“position”,“fixed”),n.css(“top”,g+“px”)))},u.$onResize=function(){u.$parseOffsets(),u.checkPosition()},u.$debouncedOnResize=o(u.$onResize,50),u.$parseOffsets=function(){var t=n.css(“position”);n.css(“position”,p.offsetParent?“”:“relative”),p.offsetTop&&(“auto”===p.offsetTop&&(p.offsetTop=“+0”),p.offsetTop.match(/^d+$/)?(g=1*-p.offsetTop,$=p.offsetParent?s.offset(b).top+1*p.offsetTop:s.offset(n).top-s.css(n,“marginTop”,!0)+1*p.offsetTop):$=1*p.offsetTop),p.offsetBottom&&(v=p.offsetParent&&p.offsetBottom.match(/^d+$/)?l()-(s.offset(b).top+s.height(b))+1*p.offsetBottom+1:1*p.offsetBottom),n.css(“position”,t)},u.init(),u}var f=angular.element(e.document.body),i=angular.element(e);return n}]}).directive(“bsAffix”,[“$affix”,“$window”,function(t,e){return{restrict:“EAC”,require:“^?bsAffixTarget”,function(o,s,n,f){var i={scope:o,offsetTop:“auto”,target:f?f.$element:angular.element(e)};angular.forEach(,function(t){angular.isDefined(n)&&(i=n)});var r=t(s,i);o.$on(“$destroy”,function(){r&&r.destroy(),i=null,r=null})}}}]).directive(“bsAffixTarget”,function(){return{controller:}}); //# sourceMappingURL=affix.min.js.map