20171_comercioeletronico_at.../tether-1.3.3/docs/welcome/js/tether-v0.1.3.js

2 lines
12 KiB
JavaScript
Raw Normal View History

2017-03-04 00:59:11 +00:00
/*! tether.js 0.1.3 */
(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=[].slice,s=function(a,b){return function(){return a.apply(b,arguments)}};a=jQuery,l=/msie [\w.]+/.test(navigator.userAgent.toLowerCase()),k=function(b){var c,d;return c=b.css("position"),"fixed"===c?b:(d=void 0,d="absolute"===c||l&&("static"===c||"relative"===c)?b.parents().filter(function(){var b;return("relative"===(b=a.css(this,"position"))||"absolute"===b||"fixed"===b)&&/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).first():b.parents().filter(function(){return/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).first(),d.length?d:a("html"))},b=16,j=function(a,c){var d;return null==c&&(c=b),d=!1,function(){var b,e=this;if(!d)return b=arguments,d=!0,setTimeout(function(){return d=!1,a.apply(e,b)},c),!0}},q=[],p=function(){var a,b,c;for(b=0,c=q.length;c>b;b++)a=q[b],a.position();return!0},l&&(p=j(p)),a(window).on("resize scroll",p),c={center:"center",left:"right",right:"left"},d={middle:"middle",top:"bottom",bottom:"top"},e={top:"0",left:"0",middle:"50%",center:"50%",bottom:"100%",right:"100%"},i=function(a,b){var e,f;return e=a.left,f=a.top,"auto"===e&&(e=c[b.left]),"auto"===f&&(f=d[b.top]),{left:e,top:f}},h=function(a){var b,c;return{left:null!=(b=e[a.left])?b:a.left,top:null!=(c=e[a.top])?c:a.top}},g=function(){var a,b,c,d,e,f,g;for(b=1<=arguments.length?r.call(arguments,0):[],c={top:0,left:0},e=0,f=b.length;f>e;e++)g=b[e],d=g.top,a=g.left,"string"==typeof d&&(d=parseFloat(d,10)),"string"==typeof a&&(a=parseFloat(a,10)),c.top+=d,c.left+=a;return c},m=function(b,c){return"string"==typeof b.left&&-1!==b.left.indexOf("%")&&(b.left=parseFloat(b.left,10)/100*a(c).outerWidth()),"string"==typeof b.top&&-1!==b.top.indexOf("%")&&(b.top=parseFloat(b.top,10)/100*a(c).outerHeight()),b},n=o=function(a){var b,c,d;return d=a.split(" "),c=d[0],b=d[1],{top:c,left:b}},f=function(){function b(a){this.position=s(this.position,this);var c,d,e,f,g;for(q.push(this),this.history=[],this.setOptions(a,!1),f=b.modules,d=0,e=f.length;e>d;d++)c=f[d],null!=(g=c.initialize)&&g.call(this);this.position()}return b.modules=[],b.prototype.setOptions=function(b,c){var d,e;return this.options=b,null==c&&(c=!0),d={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto"},this.options=a.extend(d,this.options),e=this.options,this.element=e.element,this.target=e.target,this.element.jquery&&(this.$element=this.element,this.element=this.element[0]),this.target.jquery&&(this.$target=this.target,this.target=this.target[0]),null==this.$element&&(this.$element=a(this.element)),null==this.$target&&(this.$target=a(this.target)),this.$element.addClass("tether-element"),this.$target.addClass("tether-target"),this.targetAttachment=n(this.options.targetAttachment),this.attachment=n(this.options.attachment),this.offset=o(this.options.offset),this.targetOffset=o(this.options.targetOffset),null!=this.scrollParent&&this.disable(),this.scrollParent=k(a(this.target)),this.options.enabled!==!1?this.enable(c):void 0},b.prototype.enable=function(a){return null==a&&(a=!0),this.addClass("tether-enabled"),this.enabled=!0,this.scrollParent.on("scroll",this.position),a?this.position():void 0},b.prototype.disable=function(){return this.removeClass("tether-enabled"),this.enabled=!1,null!=this.scrollParent?this.scrollParent.off("scroll",this.position):void 0},b.prototype.destroy=function(){var a,b,c,d,e;for(this.disable(),e=[],a=c=0,d=q.length;d>c;a=++c){if(b=q[a],b===this){q.splice(a,1);break}e.push(void 0)}return e},b.prototype.updateAttachClasses=function(a,b){var c,d,e,f,g,h;for(null==a&&(a=this.attachment),null==b&&(b=this.targetAttachment),d=["left","top","bottom","right","middle","center"],e=0,g=d.length;g>e;e++)c=d[e],this.removeClass("tether-element-attached-"+c);for(a.top&&this.addClass("tether-element-attached-"+a.top),a.left&&this.addClass("tether-element-attached-"+a.left),f=0,h=d.length;h>f;f++)c=d[f],this.removeClass("tether-target-attached-"+c);return b.top&&this.addClass("tether-target-attached-"+b.top),b.left?this.addCl