!function(r){r.fn.mpmansory=function(t){var n=r.extend({childrenClass:"",breakpoints:{lg:4,md:4,sm:6,xs:12},distributeBy:{attr:"data-order",attrOrder:"asc",order:!1,height:!1},onload:function(r){return!0}},t) return Array.min=function(r){return Math.min.apply(Math,r)},r.emptyArray=function(r){for(var t=0;ti;i++){var a=r("
") a.addClass(n),r(this).append(a),e.push(a)}return e},r.fn.distributeItemsByHeight=function(r,t){for(var n=0;n1200?"lg":r(window).width()>992?"md":r(window).width()>720?"sm":r(window).width()>480?"xs":(r(window).width()>320,"xs")},r.fn.distributeItemsByOrder=function(r,t){for(var n=0,e=0;e1?(a==n[s].length&&(a=0),t[i].append(r(n[s][a])),a++):t[i].append(r(n[s])),i++},r.fn.apply=function(t,n,e,i){var a=r(this),s=(a.getCurrentColumnSize(),n),o="col-lg-"+t.breakpoints.lg+" col-md-"+t.breakpoints.md+" col-sm-"+t.breakpoints.sm+" col-xs-"+t.breakpoints.xs+" "+t.columnClasses return e=r(this).initialize(s,o),t.distributeBy.order?a.distributeItemsByOrder(e,i):t.distributeBy.height?a.distributeItemsByHeight(e,i):t.distributeBy.attr&&a.distributeItemsByAttr(e,a.orderItemsByAttr(i,t.distributeBy),t.distributeBy),{wrappers:e,items:i}},this.each(function(){var t=r(this),e=t.getCurrentColumnSize(),i=12/n.breakpoints[e],a=t.children(""!=n.childrenClass?"."+n.childrenClass:"div"),s=new Array,o=t.apply(n,i,s,a) s=o.wrappers,r(window).on("resize",function(u){t.getCurrentColumnSize()!=e&&(i=12/n.breakpoints[t.getCurrentColumnSize()],s=r.emptyArray(s),o=t.apply(n,i,s,a),s=o.wrappers,e=t.getCurrentColumnSize())}),n.hasOwnProperty("onload")&&n.onload(a)})}}(jQuery)