RadarParlamentar-MES2017-1/radar

View on GitHub
radar_parlamentar/static/files/codes/js/jquery.quicksand.min.js

Summary

Maintainability
A
0 mins
Test Coverage
(function(e){e.fn.quicksand=function(t,n){var r={duration:750,easing:"swing",attribute:"data-id",adjustHeight:"auto",useScaling:true,enhancement:function(e){},selector:"> *",dx:0,dy:0};e.extend(r,n);if(e.browser.msie||typeof e.fn.scale=="undefined"){r.useScaling=false}var i;if(typeof arguments[1]=="function"){var i=arguments[1]}else if(typeof (arguments[2]=="function")){var i=arguments[2]}return this.each(function(n){var s;var o=[];var u=e(t).clone();var a=e(this);var f=e(this).css("height");var l;var c=false;var h=e(a).offset();var p=[];var v=e(this).find(r.selector);if(e.browser.msie&&e.browser.version.substr(0,1)<7){a.html("").append(u);return}var m=0;var g=function(){if(!m){m=1;$toDelete=a.find("> *");a.prepend(S.find("> *"));$toDelete.remove();if(c){a.css("height",l)}r.enhancement(a);if(typeof i=="function"){i.call(this)}}};var y=a.offsetParent();var b=y.offset();if(y.css("position")=="relative"){if(y.get(0).nodeName.toLowerCase()=="body"){}else{b.top+=parseFloat(y.css("border-top-width"))||0;b.left+=parseFloat(y.css("border-left-width"))||0}}else{b.top-=parseFloat(y.css("border-top-width"))||0;b.left-=parseFloat(y.css("border-left-width"))||0;b.top-=parseFloat(y.css("margin-top"))||0;b.left-=parseFloat(y.css("margin-left"))||0}if(isNaN(b.left)){b.left=0}if(isNaN(b.top)){b.top=0}b.left-=r.dx;b.top-=r.dy;a.css("height",e(this).height());v.each(function(t){p[t]=e(this).offset()});e(this).stop();var w=0;var E=0;v.each(function(t){e(this).stop();var n=e(this).get(0);if(n.style.position=="absolute"){w=-r.dx;E=-r.dy}else{w=r.dx;E=r.dy}n.style.position="absolute";n.style.margin="0";n.style.top=p[t].top-parseFloat(n.style.marginTop)-b.top+E+"px";n.style.left=p[t].left-parseFloat(n.style.marginLeft)-b.left+w+"px"});var S=e(a).clone();var x=S.get(0);x.innerHTML="";x.setAttribute("id","");x.style.height="auto";x.style.width=a.width()+"px";S.append(u);S.insertBefore(a);S.css("opacity",0);x.style.zIndex=-1;x.style.margin="0";x.style.position="absolute";x.style.top=h.top-b.top+"px";x.style.left=h.left-b.left+"px";if(r.adjustHeight==="dynamic"){a.animate({height:S.height()},r.duration,r.easing)}else if(r.adjustHeight==="auto"){l=S.height();if(parseFloat(f)<parseFloat(l)){a.css("height",l)}else{c=true}}v.each(function(t){var n=[];if(typeof r.attribute=="function"){s=r.attribute(e(this));u.each(function(){if(r.attribute(this)==s){n=e(this);return false}})}else{n=u.filter("["+r.attribute+"="+e(this).attr(r.attribute)+"]")}if(n.length){if(!r.useScaling){o.push({element:e(this),animation:{top:n.offset().top-b.top,left:n.offset().left-b.left,opacity:1}})}else{o.push({element:e(this),animation:{top:n.offset().top-b.top,left:n.offset().left-b.left,opacity:1,scale:"1.0"}})}}else{if(!r.useScaling){o.push({element:e(this),animation:{opacity:"0.0"}})}else{o.push({element:e(this),animation:{opacity:"0.0",scale:"0.0"}})}}});u.each(function(t){var n=[];var i=[];if(typeof r.attribute=="function"){s=r.attribute(e(this));v.each(function(){if(r.attribute(this)==s){n=e(this);return false}});u.each(function(){if(r.attribute(this)==s){i=e(this);return false}})}else{n=v.filter("["+r.attribute+"="+e(this).attr(r.attribute)+"]");i=u.filter("["+r.attribute+"="+e(this).attr(r.attribute)+"]")}var f;if(n.length===0){if(!r.useScaling){f={opacity:"1.0"}}else{f={opacity:"1.0",scale:"1.0"}}d=i.clone();var l=d.get(0);l.style.position="absolute";l.style.margin="0";l.style.top=i.offset().top-b.top+"px";l.style.left=i.offset().left-b.left+"px";d.css("opacity",0);if(r.useScaling){d.css("transform","scale(0.0)")}d.appendTo(a);o.push({element:e(d),animation:f})}});S.remove();r.enhancement(a);for(n=0;n<o.length;n++){o[n].element.animate(o[n].animation,r.duration,r.easing,g)}})}})(jQuery)