diff --git a/bower.json b/bower.json index d10e1b0f..c6211d4d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tether", - "version": "0.3.5", + "version": "0.3.6", "homepage": "https://github.hubspot.com/tether", "authors": [ "Zack Bloom ", diff --git a/package.json b/package.json index ca33d2b4..215c97c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tether", - "version": "0.3.5", + "version": "0.3.6", "description": "A client-side library to make absolutely positioned elements attach to elements in the page efficiently.", "authors": [ "Zack Bloom ", diff --git a/tether.js b/tether.js index 1b133240..c737adb0 100644 --- a/tether.js +++ b/tether.js @@ -1,4 +1,4 @@ -/*! tether 0.3.5 */ +/*! tether 0.3.6 */ (function() { var Evented, addClass, extend, getBounds, getOffsetParent, getScrollParent, hasClass, removeClass, __hasProp = {}.hasOwnProperty, diff --git a/tether.min.js b/tether.min.js index 63ea1c41..b0ae1f37 100644 --- a/tether.min.js +++ b/tether.min.js @@ -1,2 +1,2 @@ -/*! tether 0.3.5 */ -(function(){var t,e,o,i,s,n,l,r,h={}.hasOwnProperty,a=[].slice;null==window.Tether&&(window.Tether={}),n=function(t){var e,o,i,s,n;if(o=getComputedStyle(t).position,"fixed"===o)return t;for(i=void 0,e=t;e=e.parentNode;){if(!(s=getComputedStyle(e)))return e;if(/(auto|scroll)/.test(s.overflow+s["overflow-y"]+s["overflow-x"])&&("absolute"!==o||"relative"===(n=s.position)||"absolute"===n||"fixed"===n))return e}return document.body},i=function(t){var e,i,s;return t===document?(i=document,t=document.documentElement):i=t.ownerDocument,s=i.documentElement,e=o({},t.getBoundingClientRect()),e.top=e.top+window.pageYOffset-s.clientTop,e.left=e.left+window.pageXOffset-s.clientLeft,e.right=i.body.clientWidth-e.width-e.left,e.bottom=i.body.clientHeight-e.height-e.top,e},s=function(t){return t.offsetParent||document.documentElement},o=function(t){var e,o,i,s,n,l,r;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),r=e.slice(1),n=0,l=r.length;l>n;n++)if(i=r[n])for(o in i)h.call(i,o)&&(s=i[o],t[o]=s);return t},r=function(t,e){var o,i,s,n,l;if(null!=t.classList){for(n=e.split(" "),l=[],i=0,s=n.length;s>i;i++)o=n[i],l.push(t.classList.remove(o));return l}return t.className=t.className.replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," ")},e=function(t,e){var o,i,s,n,l;if(null!=t.classList){for(n=e.split(" "),l=[],i=0,s=n.length;s>i;i++)o=n[i],l.push(t.classList.add(o));return l}return r(t,e),t.className+=" "+e},l=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},t=function(){function t(){}return t.prototype.on=function(t,e,o,i){var s;return null==i&&(i=!1),null==this.bindings&&(this.bindings={}),null==(s=this.bindings)[t]&&(s[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:i})},t.prototype.once=function(t,e,o){return this.on(t,e,o,!0)},t.prototype.off=function(t,e){var o,i,s;if(null!=(null!=(i=this.bindings)?i[t]:void 0)){if(null==e)return delete this.bindings[t];for(o=0,s=[];oe;e++)t=w[e],i.push(t.position());return i},c=null,E=["resize","scroll"],T=0,x=E.length;x>T;T++)h=E[T],window.addEventListener(h,function(){return null==c||new Date-c>16?(c=+new Date,C()):void 0});t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},o={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},l=function(o,i){var s,n;return s=o.left,n=o.top,"auto"===s&&(s=t[i.left]),"auto"===n&&(n=e[i.top]),{left:s,top:n}},n=function(t){var e,i;return{left:null!=(e=o[t.left])?e:t.left,top:null!=(i=o[t.top])?i:t.top}},s=function(){var t,e,o,i,s,n,l;for(e=1<=arguments.length?B.call(arguments,0):[],o={top:0,left:0},s=0,n=e.length;n>s;s++)l=e[s],i=l.top,t=l.left,"string"==typeof i&&(i=parseFloat(i,10)),"string"==typeof t&&(t=parseFloat(t,10)),o.top+=i,o.left+=t;return o},m=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},b=v=function(t){var e,o,i;return i=t.split(" "),o=i[0],e=i[1],{top:o,left:e}},O=function(){function t(t){this.position=H(this.position,this);var e,o,i,s,n;for(w.push(this),this.history=[],this.setOptions(t,!1),s=Tether.modules,o=0,i=s.length;i>o;o++)e=s[o],null!=(n=e.initialize)&&n.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,o;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(o=this.options.classes)?o[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var o,s,n,l,r,h;for(this.options=t,null==e&&(e=!0),o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=a(o,this.options),r=this.options,this.element=r.element,this.target=r.target,this.targetModifier=r.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),h=["element","target"],n=0,l=h.length;l>n;n++){if(s=h[n],null==this[s])throw new Error("Tether Error: Both element and target must be defined");null!=this[s].jquery?this[s]=this[s][0]:"string"==typeof this[s]&&(this[s]=document.querySelector(this[s]))}if(i(this.element,this.getClass("element")),i(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=b(this.options.targetAttachment),this.attachment=b(this.options.attachment),this.offset=v(this.options.offset),this.targetOffset=v(this.options.targetOffset),null!=this.scrollParent&&this.disable(),this.scrollParent=g(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){if(null==this.targetModifier)return f(this.target);switch(this.targetModifier){case"visible":return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};case"scroll-handle":return{top:pageYOffset+innerHeight*(pageYOffset/document.body.scrollHeight),left:innerWidth-15,height:.98*innerHeight*(innerHeight/document.body.scrollHeight),width:15}}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),this.addClass(this.getClass("enabled")),this.enabled=!0,this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return this.removeClass(this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,o,i,s;for(this.disable(),s=[],t=o=0,i=w.length;i>o;t=++o){if(e=w[t],e===this){w.splice(t,1);break}s.push(void 0)}return s},t.prototype.updateAttachClasses=function(t,e){var o,i,s,n,l,r;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),i=["left","top","bottom","right","middle","center"],s=0,l=i.length;l>s;s++)o=i[s],this.removeClass(""+this.getClass("element-attached")+"-"+o);for(t.top&&this.addClass(""+this.getClass("element-attached")+"-"+t.top),t.left&&this.addClass(""+this.getClass("element-attached")+"-"+t.left),n=0,r=i.length;r>n;n++)o=i[n],this.removeClass(""+this.getClass("target-attached")+"-"+o);return e.top&&this.addClass(""+this.getClass("target-attached")+"-"+e.top),e.left?this.addClass(""+this.getClass("target-attached")+"-"+e.left):void 0},t.prototype.addClass=function(t){return i(this.element,t),i(this.target,t)},t.prototype.removeClass=function(t){return y(this.element,t),y(this.target,t)},t.prototype.position=function(){var t,e,o,i,r,h,a,u,g,d,c,b,v,C,y,w,O,T,x,P,E,B,H,S,A,L,Y,F,N,W,z=this;if(this.enabled){for(this.clearCache(),T=l(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,T),t=this.cache("element-bounds",function(){return f(z.element)}),H=t.width,e=t.height,E=P=this.cache("target-bounds",function(){return z.getTargetBounds()}),u=m(n(this.attachment),{width:H,height:e}),x=m(n(T),E),i=m(this.offset,{width:H,height:e}),r=m(this.targetOffset,E),u=s(u,i),o=P.left+x.left-u.left,B=P.top+x.top-u.top,F=Tether.modules,S=0,L=F.length;L>S;S++)if(h=F[S],C=h.position.call(this,{left:o,top:B,targetAttachment:T,targetPos:P,elementPos:t,offset:u,targetOffset:x,manualOffset:i,manualTargetOffset:r}),null!=C&&"object"==typeof C){if(C===!1)return!1;B=C.top,o=C.left}if(a={page:{top:B,bottom:document.body.scrollHeight-B-e,left:o,right:document.body.scrollWidth-o-H},viewport:{top:B-pageYOffset,bottom:pageYOffset-B-e+innerHeight,left:o-pageXOffset,right:pageXOffset-o-H+innerWidth}},(null!=(N=this.options.optimizations)?N.moveElement:void 0)!==!1&&null==this.targetModifier){for(d=this.cache("target-offsetparent",function(){return p(z.target)}),v=this.cache("target-offsetparent-bounds",function(){return f(d)}),b=getComputedStyle(d),c=v,g={},W=["top","left","bottom","right"],A=0,Y=W.length;Y>A;A++)O=W[A],g[O]=parseFloat(b["border-"+O+"-width"]);v.left+=g.left,v.top+=g.top,v.right=document.body.scrollWidth-v.left-c.width,v.bottom=document.body.scrollHeight-v.top-c.height,a.page.top>=v.top&&a.page.bottom>=v.bottom&&a.page.left>=v.left&&a.page.right>=v.right&&(w=d.scrollTop,y=d.scrollLeft,a.offset={top:a.page.top-v.top+w+g.top,left:a.page.left-v.left+y+g.left,right:a.page.right-v.right+d.scrollWidth-y+g.right,bottom:a.page.bottom-v.bottom+d.scrollHeight-w+g.bottom})}return this.move(a),this.history.unshift(a),this.history.length>3&&this.history.pop(),!0}},t.prototype.move=function(t){var e,o,i,s,n,l,r,h,f,u,g,d,c,m,b,v,C,y,w,O,T,x=this;if(null!=this.element.parentNode){f={};for(d in t){f[d]={};for(i in t[d]){for(o=!1,w=this.history,b=0,C=w.length;C>b;b++)if(h=w[b],(null!=(O=h[d])?O[i]:void 0)!==t[d][i]){o=!0;break}o||(f[d][i]=!0)}}if(e={top:"",left:"",right:"",bottom:""},g=function(t,o){return t.top?e.top=""+o.top+"px":e.bottom=""+o.bottom+"px",t.left?e.left=""+o.left+"px":e.right=""+o.right+"px"},s=!1,(f.page.top||f.page.bottom)&&(f.page.left||f.page.right))e.position="absolute",g(f.page,t.page);else if((f.viewport.top||f.viewport.bottom)&&(f.viewport.left||f.viewport.right))e.position="fixed",g(f.viewport,t.viewport);else if(null!=f.offset&&(f.offset.top||f.offset.bottom)&&(f.offset.left||f.offset.right)){for(e.position="absolute",l=this.cache("target-offsetparent",function(){return p(x.target)}),p(this.element)!==l&&(this.element.parentNode.removeChild(this.element),l.appendChild(this.element)),r=getComputedStyle(l),n=a({},t.offset),T=["top","left","bottom","right"],v=0,y=T.length;y>v;v++)u=T[v],n[u]-=parseFloat(r["border-"+u+"-width"]);g(f.offset,n),s=!0}else e.position="absolute",e.top=""+t.page.top+"px",e.left=""+t.page.left+"px";s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),m=!1;for(i in e)if(c=e[i],this.element.style[i]!==c){m=!0;break}return m?a(this.element.style,e):void 0}},t}(),window.Tether=a(O,Tether)}.call(this),function(){var t,e,o,i,s,n,l,r,h=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};r=Tether.Utils,n=r.getOuterSize,s=r.getBounds,l=r.getSize,o=r.extend,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],i=function(e,o){var i,n,l,r,h,a,f;if("scrollParent"===o?o=e.scrollParent:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),null!=o.nodeType)for(n=r=s(o),h=getComputedStyle(o),o=[n.left,n.top,r.width+n.left,r.height+n.top],i=a=0,f=t.length;f>a;i=++a)l=t[i],"top"===l||"left"===l?o[i]+=parseFloat(h["border-"+l+"-width"]):o[i]-=parseFloat(h["border-"+l+"-width"]);return o},Tether.modules.push({position:function(e){var n,l,r,a,f,p,u,g,d,c,m,b,v,C,y,w,O,T,x,P,E,B,H,S,A,L,Y,F,N,W,z,M,X,_,j,D,U,k,R,q,$,G,I=this;if(A=e.top,d=e.left,P=e.targetAttachment,!this.options.constraints)return!0;for(w=function(e){var o,i,s,n;for(I.removeClass(e),n=[],i=0,s=t.length;s>i;i++)o=t[i],n.push(I.removeClass(""+e+"-"+o));return n},U=this.cache("element-bounds",function(){return s(I.element)}),g=U.height,L=U.width,B=this.cache("target-bounds",function(){return I.getTargetBounds()}),E=B.height,H=B.width,x={},u={},O=[this.getClass("pinned"),this.getClass("out-of-bounds")],k=this.options.constraints,Y=0,z=k.length;z>Y;Y++)p=k[Y],p.outOfBoundsClass&&O.push(p.outOfBoundsClass),p.pinnedClass&&O.push(p.pinnedClass);for(F=0,M=O.length;M>F;F++)f=O[F],w(f);for(x=o({},P),u=o({},this.attachment),R=this.options.constraints,N=0,X=R.length;X>N;N++){if(p=R[N],S=p.to,n=p.attachment,v=p.pin,null==n&&(n=""),h.call(n," ")>=0?(q=n.split(" "),a=q[0],r=q[1]):r=a=n,l=i(this,S),("target"===a||"both"===a)&&(Al[3]&&"bottom"===x.top&&(A-=E,x.top="top")),"together"===a&&(Al[3]&&"bottom"===x.top&&("top"===u.top?(A-=E,x.top="top",A-=g,u.top="bottom"):"bottom"===u.top&&(A-=E,x.top="top",A+=g,u.top="top"))),("target"===r||"both"===r)&&(dl[2]&&"right"===x.left&&(d-=H,x.left="left")),"together"===r&&(dl[2]&&"right"===x.left&&("left"===u.left?(d-=H,x.left="left",d-=L,u.left="right"):"right"===u.left&&(d-=H,x.left="left",d+=L,u.left="left"))),("element"===a||"both"===a)&&(Al[3]&&"top"===u.top&&(A-=g,u.top="bottom")),("element"===r||"both"===r)&&(dl[2]&&"left"===u.left&&(d-=L,u.left="right")),"string"==typeof v?v=function(){var t,e,o,i;for(o=v.split(","),i=[],t=0,e=o.length;e>t;t++)b=o[t],i.push(b.trim());return i}():v===!0&&(v=["top","left","right","bottom"]),v||(v=[]),C=[],c=[],A=0?(A=l[1],C.push("top")):c.push("top")),A+g>l[3]&&(h.call(v,"bottom")>=0?(A=l[3]-g,C.push("bottom")):c.push("bottom")),d=0?(d=l[0],C.push("left")):c.push("left")),d+L>l[2]&&(h.call(v,"right")>=0?(d=l[2]-L,C.push("right")):c.push("right")),C.length)for(y=null!=($=this.options.pinnedClass)?$:this.getClass("pinned"),this.addClass(y),W=0,_=C.length;_>W;W++)T=C[W],this.addClass(""+y+"-"+T);if(c.length)for(m=null!=(G=this.options.outOfBoundsClass)?G:this.getClass("out-of-bounds"),this.addClass(m),D=0,j=c.length;j>D;D++)T=c[D],this.addClass(""+m+"-"+T);(h.call(C,"left")>=0||h.call(C,"right")>=0)&&(u.left=x.left=!1),(h.call(C,"top")>=0||h.call(C,"bottom")>=0)&&(u.top=x.top=!1),(x.top!==P.top||x.left!==P.left||u.top!==this.attachment.top||u.left!==this.attachment.left)&&this.updateAttachClasses(u,x)}return{top:A,left:d}}})}.call(this),function(){var t;t=Tether.Utils.getBounds,Tether.modules.push({position:function(e){var o,i,s,n,l,r,h,a,f,p,u,g,d,c,m,b,v,C,y,w,O,T,x,P=this;if(f=e.top,n=e.left,y=this.cache("element-bounds",function(){return t(P.element)}),s=y.height,p=y.width,a=this.getTargetBounds(),i=f+s,l=n+p,o=[],f<=a.bottom&&i>=a.top)for(w=["left","right"],u=0,m=w.length;m>u;u++)r=w[u],((O=a[r])===n||O===l)&&o.push(r);if(n<=a.right&&l>=a.left)for(T=["top","bottom"],g=0,b=T.length;b>g;g++)r=T[g],((x=a[r])===f||x===i)&&o.push(r);for(h=["left","top","right","bottom"],this.removeClass(this.getClass("abutted")),d=0,v=h.length;v>d;d++)r=h[d],this.removeClass(""+this.getClass("abutted")+"-"+r);for(o.length&&this.addClass(this.getClass("abutted")),c=0,C=o.length;C>c;c++)r=o[c],this.addClass(""+this.getClass("abutted")+"-"+r);return!0}})}.call(this),function(){Tether.modules.push({position:function(t){var e,o,i,s,n,l,r;return l=t.top,e=t.left,this.options.shift?(o=function(t){return"function"==typeof t?t.call(this,{top:l,left:e}):t},i=o(this.options.shift),"string"==typeof i?(i=i.split(" "),i[1]||(i[1]=i[0]),n=i[0],s=i[1],n=parseFloat(n,10),s=parseFloat(s,10)):(r=[i.top,i.left],n=r[0],s=r[1]),l+=n,e+=s,{top:l,left:e}):void 0}})}.call(this); \ No newline at end of file +/*! tether 0.3.6 */ +(function(){var t,e,o,i,s,n,l,r,h={}.hasOwnProperty,a=[].slice;null==window.Tether&&(window.Tether={}),n=function(t){var e,o,i,s,n;if(o=getComputedStyle(t).position,"fixed"===o)return t;for(i=void 0,e=t;e=e.parentNode;){if(!(s=getComputedStyle(e)))return e;if(/(auto|scroll)/.test(s.overflow+s["overflow-y"]+s["overflow-x"])&&("absolute"!==o||"relative"===(n=s.position)||"absolute"===n||"fixed"===n))return e}return document.body},i=function(t){var e,i,s;return t===document?(i=document,t=document.documentElement):i=t.ownerDocument,s=i.documentElement,e=o({},t.getBoundingClientRect()),e.top=e.top+window.pageYOffset-s.clientTop,e.left=e.left+window.pageXOffset-s.clientLeft,e.right=i.body.clientWidth-e.width-e.left,e.bottom=i.body.clientHeight-e.height-e.top,e},s=function(t){return t.offsetParent||document.documentElement},o=function(t){var e,o,i,s,n,l,r;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),r=e.slice(1),n=0,l=r.length;l>n;n++)if(i=r[n])for(o in i)h.call(i,o)&&(s=i[o],t[o]=s);return t},r=function(t,e){var o,i,s,n,l;if(null!=t.classList){for(n=e.split(" "),l=[],i=0,s=n.length;s>i;i++)o=n[i],l.push(t.classList.remove(o));return l}return t.className=t.className.replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," ")},e=function(t,e){var o,i,s,n,l;if(null!=t.classList){for(n=e.split(" "),l=[],i=0,s=n.length;s>i;i++)o=n[i],l.push(t.classList.add(o));return l}return r(t,e),t.className+=" "+e},l=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},t=function(){function t(){}return t.prototype.on=function(t,e,o,i){var s;return null==i&&(i=!1),null==this.bindings&&(this.bindings={}),null==(s=this.bindings)[t]&&(s[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:i})},t.prototype.once=function(t,e,o){return this.on(t,e,o,!0)},t.prototype.off=function(t,e){var o,i,s;if(null!=(null!=(i=this.bindings)?i[t]:void 0)){if(null==e)return delete this.bindings[t];for(o=0,s=[];oe;e++)t=w[e],i.push(t.position());return i},c=null,E=["resize","scroll"],T=0,x=E.length;x>T;T++)h=E[T],window.addEventListener(h,function(){return null==c||new Date-c>16?(c=+new Date,C()):void 0});t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},o={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},l=function(o,i){var s,n;return s=o.left,n=o.top,"auto"===s&&(s=t[i.left]),"auto"===n&&(n=e[i.top]),{left:s,top:n}},n=function(t){var e,i;return{left:null!=(e=o[t.left])?e:t.left,top:null!=(i=o[t.top])?i:t.top}},s=function(){var t,e,o,i,s,n,l;for(e=1<=arguments.length?B.call(arguments,0):[],o={top:0,left:0},s=0,n=e.length;n>s;s++)l=e[s],i=l.top,t=l.left,"string"==typeof i&&(i=parseFloat(i,10)),"string"==typeof t&&(t=parseFloat(t,10)),o.top+=i,o.left+=t;return o},m=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},b=v=function(t){var e,o,i;return i=t.split(" "),o=i[0],e=i[1],{top:o,left:e}},O=function(){function t(t){this.position=H(this.position,this);var e,o,i,s,n;for(w.push(this),this.history=[],this.setOptions(t,!1),s=Tether.modules,o=0,i=s.length;i>o;o++)e=s[o],null!=(n=e.initialize)&&n.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,o;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(o=this.options.classes)?o[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var o,s,n,l,r,h;for(this.options=t,null==e&&(e=!0),o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=a(o,this.options),r=this.options,this.element=r.element,this.target=r.target,this.targetModifier=r.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),h=["element","target"],n=0,l=h.length;l>n;n++){if(s=h[n],null==this[s])throw new Error("Tether Error: Both element and target must be defined");null!=this[s].jquery?this[s]=this[s][0]:"string"==typeof this[s]&&(this[s]=document.querySelector(this[s]))}if(i(this.element,this.getClass("element")),i(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=b(this.options.targetAttachment),this.attachment=b(this.options.attachment),this.offset=v(this.options.offset),this.targetOffset=v(this.options.targetOffset),null!=this.scrollParent&&this.disable(),this.scrollParent=g(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){if(null==this.targetModifier)return f(this.target);switch(this.targetModifier){case"visible":return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};case"scroll-handle":return{top:pageYOffset+innerHeight*(pageYOffset/document.body.scrollHeight),left:innerWidth-15,height:.98*innerHeight*(innerHeight/document.body.scrollHeight),width:15}}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),this.addClass(this.getClass("enabled")),this.enabled=!0,this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return this.removeClass(this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,o,i,s;for(this.disable(),s=[],t=o=0,i=w.length;i>o;t=++o){if(e=w[t],e===this){w.splice(t,1);break}s.push(void 0)}return s},t.prototype.updateAttachClasses=function(t,e){var o,i,s,n,l,r;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),i=["left","top","bottom","right","middle","center"],s=0,l=i.length;l>s;s++)o=i[s],this.removeClass(""+this.getClass("element-attached")+"-"+o);for(t.top&&this.addClass(""+this.getClass("element-attached")+"-"+t.top),t.left&&this.addClass(""+this.getClass("element-attached")+"-"+t.left),n=0,r=i.length;r>n;n++)o=i[n],this.removeClass(""+this.getClass("target-attached")+"-"+o);return e.top&&this.addClass(""+this.getClass("target-attached")+"-"+e.top),e.left?this.addClass(""+this.getClass("target-attached")+"-"+e.left):void 0},t.prototype.addClass=function(t){return i(this.element,t),i(this.target,t)},t.prototype.removeClass=function(t){return y(this.element,t),y(this.target,t)},t.prototype.position=function(){var t,e,o,i,r,h,a,u,g,d,c,b,v,C,y,w,O,T,x,P,E,B,H,S,A,L,Y,F,N,W,z=this;if(this.enabled){for(this.clearCache(),T=l(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,T),t=this.cache("element-bounds",function(){return f(z.element)}),H=t.width,e=t.height,E=P=this.cache("target-bounds",function(){return z.getTargetBounds()}),u=m(n(this.attachment),{width:H,height:e}),x=m(n(T),E),i=m(this.offset,{width:H,height:e}),r=m(this.targetOffset,E),u=s(u,i),o=P.left+x.left-u.left,B=P.top+x.top-u.top,F=Tether.modules,S=0,L=F.length;L>S;S++)if(h=F[S],C=h.position.call(this,{left:o,top:B,targetAttachment:T,targetPos:P,elementPos:t,offset:u,targetOffset:x,manualOffset:i,manualTargetOffset:r}),null!=C&&"object"==typeof C){if(C===!1)return!1;B=C.top,o=C.left}if(a={page:{top:B,bottom:document.body.scrollHeight-B-e,left:o,right:document.body.scrollWidth-o-H},viewport:{top:B-pageYOffset,bottom:pageYOffset-B-e+innerHeight,left:o-pageXOffset,right:pageXOffset-o-H+innerWidth}},(null!=(N=this.options.optimizations)?N.moveElement:void 0)!==!1&&null==this.targetModifier){for(d=this.cache("target-offsetparent",function(){return p(z.target)}),v=this.cache("target-offsetparent-bounds",function(){return f(d)}),b=getComputedStyle(d),c=v,g={},W=["top","left","bottom","right"],A=0,Y=W.length;Y>A;A++)O=W[A],g[O]=parseFloat(b["border-"+O+"-width"]);v.left+=g.left,v.top+=g.top,v.right=document.body.scrollWidth-v.left-c.width,v.bottom=document.body.scrollHeight-v.top-c.height,a.page.top>=v.top&&a.page.bottom>=v.bottom&&a.page.left>=v.left&&a.page.right>=v.right&&(w=d.scrollTop,y=d.scrollLeft,a.offset={top:a.page.top-v.top+w+g.top,left:a.page.left-v.left+y+g.left,right:a.page.right-v.right+d.scrollWidth-y+g.right,bottom:a.page.bottom-v.bottom+d.scrollHeight-w+g.bottom})}return this.move(a),this.history.unshift(a),this.history.length>3&&this.history.pop(),!0}},t.prototype.move=function(t){var e,o,i,s,n,l,r,h,f,u,g,d,c,m,b,v,C,y,w,O,T,x=this;if(null!=this.element.parentNode){f={};for(d in t){f[d]={};for(i in t[d]){for(o=!1,w=this.history,b=0,C=w.length;C>b;b++)if(h=w[b],(null!=(O=h[d])?O[i]:void 0)!==t[d][i]){o=!0;break}o||(f[d][i]=!0)}}if(e={top:"",left:"",right:"",bottom:""},g=function(t,o){return t.top?e.top=""+o.top+"px":e.bottom=""+o.bottom+"px",t.left?e.left=""+o.left+"px":e.right=""+o.right+"px"},s=!1,(f.page.top||f.page.bottom)&&(f.page.left||f.page.right))e.position="absolute",g(f.page,t.page);else if((f.viewport.top||f.viewport.bottom)&&(f.viewport.left||f.viewport.right))e.position="fixed",g(f.viewport,t.viewport);else if(null!=f.offset&&(f.offset.top||f.offset.bottom)&&(f.offset.left||f.offset.right)){for(e.position="absolute",l=this.cache("target-offsetparent",function(){return p(x.target)}),p(this.element)!==l&&(this.element.parentNode.removeChild(this.element),l.appendChild(this.element)),r=getComputedStyle(l),n=a({},t.offset),T=["top","left","bottom","right"],v=0,y=T.length;y>v;v++)u=T[v],n[u]-=parseFloat(r["border-"+u+"-width"]);g(f.offset,n),s=!0}else e.position="absolute",e.top=""+t.page.top+"px",e.left=""+t.page.left+"px";s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),m=!1;for(i in e)if(c=e[i],this.element.style[i]!==c){m=!0;break}return m?a(this.element.style,e):void 0}},t}(),window.Tether=a(O,Tether)}.call(this),function(){var t,e,o,i,s,n,l,r,h=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};r=Tether.Utils,n=r.getOuterSize,s=r.getBounds,l=r.getSize,o=r.extend,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],i=function(e,o){var i,n,l,r,h,a,f;if("scrollParent"===o?o=e.scrollParent:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),null!=o.nodeType)for(n=r=s(o),h=getComputedStyle(o),o=[n.left,n.top,r.width+n.left,r.height+n.top],i=a=0,f=t.length;f>a;i=++a)l=t[i],"top"===l||"left"===l?o[i]+=parseFloat(h["border-"+l+"-width"]):o[i]-=parseFloat(h["border-"+l+"-width"]);return o},Tether.modules.push({position:function(e){var n,l,r,a,f,p,u,g,d,c,m,b,v,C,y,w,O,T,x,P,E,B,H,S,A,L,Y,F,N,W,z,M,X,_,j,D,U,k,R,q,$,G,I=this;if(A=e.top,d=e.left,P=e.targetAttachment,!this.options.constraints)return!0;for(w=function(e){var o,i,s,n;for(I.removeClass(e),n=[],i=0,s=t.length;s>i;i++)o=t[i],n.push(I.removeClass(""+e+"-"+o));return n},U=this.cache("element-bounds",function(){return s(I.element)}),g=U.height,L=U.width,B=this.cache("target-bounds",function(){return I.getTargetBounds()}),E=B.height,H=B.width,x={},u={},O=[this.getClass("pinned"),this.getClass("out-of-bounds")],k=this.options.constraints,Y=0,z=k.length;z>Y;Y++)p=k[Y],p.outOfBoundsClass&&O.push(p.outOfBoundsClass),p.pinnedClass&&O.push(p.pinnedClass);for(F=0,M=O.length;M>F;F++)f=O[F],w(f);for(x=o({},P),u=o({},this.attachment),R=this.options.constraints,N=0,X=R.length;X>N;N++){if(p=R[N],S=p.to,n=p.attachment,v=p.pin,null==n&&(n=""),h.call(n," ")>=0?(q=n.split(" "),a=q[0],r=q[1]):r=a=n,l=i(this,S),("target"===a||"both"===a)&&(Al[3]&&"bottom"===x.top&&(A-=E,x.top="top")),"together"===a&&(Al[3]&&"bottom"===x.top&&("top"===u.top?(A-=E,x.top="top",A-=g,u.top="bottom"):"bottom"===u.top&&(A-=E,x.top="top",A+=g,u.top="top"))),("target"===r||"both"===r)&&(dl[2]&&"right"===x.left&&(d-=H,x.left="left")),"together"===r&&(dl[2]&&"right"===x.left&&("left"===u.left?(d-=H,x.left="left",d-=L,u.left="right"):"right"===u.left&&(d-=H,x.left="left",d+=L,u.left="left"))),("element"===a||"both"===a)&&(Al[3]&&"top"===u.top&&(A-=g,u.top="bottom")),("element"===r||"both"===r)&&(dl[2]&&"left"===u.left&&(d-=L,u.left="right")),"string"==typeof v?v=function(){var t,e,o,i;for(o=v.split(","),i=[],t=0,e=o.length;e>t;t++)b=o[t],i.push(b.trim());return i}():v===!0&&(v=["top","left","right","bottom"]),v||(v=[]),C=[],c=[],A=0?(A=l[1],C.push("top")):c.push("top")),A+g>l[3]&&(h.call(v,"bottom")>=0?(A=l[3]-g,C.push("bottom")):c.push("bottom")),d=0?(d=l[0],C.push("left")):c.push("left")),d+L>l[2]&&(h.call(v,"right")>=0?(d=l[2]-L,C.push("right")):c.push("right")),C.length)for(y=null!=($=this.options.pinnedClass)?$:this.getClass("pinned"),this.addClass(y),W=0,_=C.length;_>W;W++)T=C[W],this.addClass(""+y+"-"+T);if(c.length)for(m=null!=(G=this.options.outOfBoundsClass)?G:this.getClass("out-of-bounds"),this.addClass(m),D=0,j=c.length;j>D;D++)T=c[D],this.addClass(""+m+"-"+T);(h.call(C,"left")>=0||h.call(C,"right")>=0)&&(u.left=x.left=!1),(h.call(C,"top")>=0||h.call(C,"bottom")>=0)&&(u.top=x.top=!1),(x.top!==P.top||x.left!==P.left||u.top!==this.attachment.top||u.left!==this.attachment.left)&&this.updateAttachClasses(u,x)}return{top:A,left:d}}})}.call(this),function(){var t;t=Tether.Utils.getBounds,Tether.modules.push({position:function(e){var o,i,s,n,l,r,h,a,f,p,u,g,d,c,m,b,v,C,y,w,O,T,x,P=this;if(f=e.top,n=e.left,y=this.cache("element-bounds",function(){return t(P.element)}),s=y.height,p=y.width,a=this.getTargetBounds(),i=f+s,l=n+p,o=[],f<=a.bottom&&i>=a.top)for(w=["left","right"],u=0,m=w.length;m>u;u++)r=w[u],((O=a[r])===n||O===l)&&o.push(r);if(n<=a.right&&l>=a.left)for(T=["top","bottom"],g=0,b=T.length;b>g;g++)r=T[g],((x=a[r])===f||x===i)&&o.push(r);for(h=["left","top","right","bottom"],this.removeClass(this.getClass("abutted")),d=0,v=h.length;v>d;d++)r=h[d],this.removeClass(""+this.getClass("abutted")+"-"+r);for(o.length&&this.addClass(this.getClass("abutted")),c=0,C=o.length;C>c;c++)r=o[c],this.addClass(""+this.getClass("abutted")+"-"+r);return!0}})}.call(this),function(){Tether.modules.push({position:function(t){var e,o,i,s,n,l,r;return l=t.top,e=t.left,this.options.shift?(o=function(t){return"function"==typeof t?t.call(this,{top:l,left:e}):t},i=o(this.options.shift),"string"==typeof i?(i=i.split(" "),i[1]||(i[1]=i[0]),n=i[0],s=i[1],n=parseFloat(n,10),s=parseFloat(s,10)):(r=[i.top,i.left],n=r[0],s=r[1]),l+=n,e+=s,{top:l,left:e}):void 0}})}.call(this); \ No newline at end of file