-
Notifications
You must be signed in to change notification settings - Fork 3
/
ordnung.min.js
3 lines (3 loc) · 957 Bytes
/
ordnung.min.js
1
2
3
// Ordnung.js
"use strict"
!function(t){var e,n=["-webkit-transform","-moz-transform","-o-transform","transform"],o=function(t){e=t};return o.prototype.layout=function(){for(var o=e.children,r=[],f={},a=0,i=Array.prototype.slice.call(o).map(function(t){return t.getBoundingClientRect()}),l=0;l<=o.length-1;l++){var u=i[l],p=0,d=0,s=u.top+t.pageYOffset;u.left in f||(f[u.left]=s); var c=f[u.left];d=d?d:s-c;var h=f[a];a!=u.left&&h>0&&c>h&&(d=s-f[a],p=a-u.left),r.push("translateY(-"+d+"px)"+(p?"translateX("+p+"px)":"")),p||(a=u.left);var v=p?a:u.left;f[v]=f[v]+u.height}for(l=0;l<o.length;l++)n.forEach(function(t){o[l].style[t]=r[l]});var m=[];for(var g in f)m.push(f[g]);var y=Math.max.apply(Math,m)-e.offsetTop;e.style.height=y-t.pageYOffset+"px"},"function"==typeof define&&define.amd?void define(function(){return o}):"undefined"!=typeof module&&module.exports?void(module.exports=o):void(t.Ordnung=t.Ordnung||o)}("undefined"!=typeof window?window:{})