MCPcopy Create free account
hub / github.com/CoderOpen/waimai / d

Function d

public/front/static/js/masonry.pkgd.js:1–1  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1(function(d){var c=Array.prototype.slice;function b(){}function a(e){if(!e){return}function f(i){if(i.prototype.option){return}i.prototype.option=function(j){if(!e.isPlainObject(j)){return}this.options=e.extend(true,this.options,j)}}var h=typeof console==="undefined"?b:function(i){console.error(i)};function g(i,j){e.fn[i]=function(p){if(typeof p==="string"){var k=c.call(arguments,1);for(var m=0,o=this.length;m<o;m++){var l=this[m];var n=e.data(l,i);if(!n){h("cannot call methods on "+i+" prior to initialization; attempted to call '"+p+"'");continue}if(!e.isFunction(n[p])||p.charAt(0)==="_"){h("no such method '"+p+"' for "+i+" instance");continue}var q=n[p].apply(n,k);if(q!==undefined){return q}}return this}else{return this.each(function(){var r=e.data(this,i);if(r){r.option(p);r._init()}else{r=new j(this,p);e.data(this,i,r)}})}}}e.bridget=function(i,j){f(j);g(i,j)};return e.bridget}if(typeof define==="function"&&define.amd){define("jquery-bridget/jquery.bridget",["jquery"],a)}else{a(d.jQuery)}})(window);(function(e){var b=document.documentElement;var a=function(){};if(b.addEventListener){a=function(g,h,f){g.addEventListener(h,f,false)}}else{if(b.attachEvent){a=function(g,h,f){g[h+f]=f.handleEvent?function(){var i=e.event;i.target=i.target||i.srcElement;f.handleEvent.call(f,i)}:function(){var i=e.event;i.target=i.target||i.srcElement;f.call(g,i)};g.attachEvent("on"+h,g[h+f])}}}var d=function(){};if(b.removeEventListener){d=function(g,h,f){g.removeEventListener(h,f,false)}}else{if(b.detachEvent){d=function(h,i,g){h.detachEvent("on"+i,h[i+g]);try{delete h[i+g]}catch(f){h[i+g]=undefined}}}}var c={bind:a,unbind:d};if(typeof define==="function"&&define.amd){define("eventie/eventie",c)}else{e.eventie=c}})(this);(function(f){var c=f.document;var e=[];function b(g){if(typeof g!=="function"){return}if(b.isReady){g()}else{e.push(g)}}b.isReady=false;function d(g){var k=g.type==="readystatechange"&&c.readyState!=="complete";if(b.isReady||k){return}b.isReady=true;for(var j=0,l=e.length;j<l;j++){var h=e[j];h()}}function a(g){g.bind(c,"DOMContentLoaded",d);g.bind(c,"readystatechange",d);g.bind(f,"load",d);return b}if(typeof define==="function"&&define.amd){b.isReady=typeof requirejs==="function";define("doc-ready/doc-ready",["eventie/eventie"],a)}else{f.docReady=a(f.eventie)}})(this);(function(){function k(){}var q=k.prototype;function o(x,w){var v=x.length;while(v--){if(x[v].listener===w){return v}}return -1}function f(w){return function v(){return this[w].apply(this,arguments)}}q.getListeners=function m(w){var v=this._getEvents();var y;var x;if(typeof w==="object"){y={};for(x in v){if(v.hasOwnProperty(x)&&w.test(x)){y[x]=v[x]}}}else{y=v[w]||(v[w]=[])}return y};q.flattenListeners=function l(x){var v=[];var w;for(w=0;w<x.length;w+=1){v.push(x[w].listener)}return v};q.getListenersAsObject=function n(v){var w=this.getListeners(v);var x;if(w instanceof Array){x={};x[v]=w}return x||w};q.addListener=function c(v,x){var z=this.getListenersAsObject(v);var y=typeof x==="object";var w;for(w in z){if(z.hasOwnProperty(w)&&o(z[w],x)===-1){z[w].push(y?x:{listener:x,once:false})}}return this};q.on=f("addListener");q.addOnceListener=function e(v,w){return this.addListener(v,{listener:w,once:true})};q.once=f("addOnceListener");q.defineEvent=function g(v){this.getListeners(v);return this};q.defineEvents=function h(v){for(var w=0;w<v.length;w+=1){this.defineEvent(v[w])}return this};q.removeListener=function s(v,y){var z=this.getListenersAsObject(v);var w;var x;for(x in z){if(z.hasOwnProperty(x)){w=o(z[x],y);if(w!==-1){z[x].splice(w,1)}}}return this};q.off=f("removeListener");q.addListeners=function d(v,w){return this.manipulateListeners(false,v,w)};q.removeListeners=function t(v,w){return this.manipulateListeners(true,v,w)};q.manipulateListeners=function p(z,v,x){var w;var B;var A=z?this.removeListener:this.addListener;var y=z?this.removeListeners:this.addListeners;if(typeof v==="object"&&!(v instanceof RegExp)){for(w in v){if(v.hasOwnProperty(w)&&(B=v[w])){if(typeof B==="function"){A.call(this,w,B)}else{y.call(this,w,B)}}}}else{w=x.length;while(w--){A.call(this,v,x[w])}}return this};q.removeEvent=function r(w){var y=typeof w;var v=this._getEvents();var x;if(y==="string"){delete v[w]}else{if(y==="object"){for(x in v){if(v.hasOwnProperty(x)&&w.test(x)){delete v[x]}}}else{delete this._events}}return this};q.removeAllListeners=f("removeEvent");q.emitEvent=function j(w,v){var A=this.getListenersAsObject(w);var z;var x;var y;var B;for(y in A){if(A.hasOwnProperty(y)){x=A[y].length;while(x--){z=A[y][x];if(z.once===true){this.removeListener(w,z.listener)}B=z.listener.apply(this,v||[]);if(B===this._getOnceReturnValue()){this.removeListener(w,z.listener)}}}}return this};q.trigger=f("emitEvent");q.emit=function i(w){var v=Array.prototype.slice.call(arguments,1);return this.emitEvent(w,v)};q.setOnceReturnValue=function u(v){this._onceReturnValue=v;return this};q._getOnceReturnValue=function b(){if(this.hasOwnProperty("_onceReturnValue")){return this._onceReturnValue}else{return true}};q._getEvents=function a(){return this._events||(this._events={})};if(typeof define==="function"&&define.amd){define("eventEmitter/EventEmitter",[],function(){return k})}else{if(typeof module==="object"&&module.exports){module.exports=k}else{this.EventEmitter=k}}}.call(this));(function(d){var c="Webkit Moz ms Ms O".split(" ");var a=document.documentElement.style;function b(h){if(!h){return}if(typeof a[h]==="string"){return h}h=h.charAt(0).toUpperCase()+h.slice(1);var g;for(var e=0,f=c.length;e<f;e++){g=c[e]+h;if(typeof a[g]==="string"){return g}}}if(typeof define==="function"&&define.amd){define("get-style-property/get-style-property",[],function(){return b})}else{d.getStyleProperty=b}})(window);(function(i,h){var b=document.defaultView;var f=b&&b.getComputedStyle;var c=f?function(j){return b.getComputedStyle(j,null)}:function(j){return j.currentStyle};function d(l){var k=parseFloat(l);var j=l.indexOf("%")===-1&&!isNaN(k);return j&&k}var g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];function e(){var m={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var j=0,k=g.length;j<k;j++){var l=g[j];m[l]=0}return m}function a(l){var j=l("boxSizing");var m;(function(){if(!j){return}var p=document.createElement("div");p.style.width="200px";p.style.padding="1px 2px 3px 4px";p.style.borderStyle="solid";p.style.borderWidth="1px 2px 3px 4px";p.style[j]="border-box";var o=document.body||document.documentElement;o.appendChild(p);var q=c(p);m=d(q.width)===200;o.removeChild(p)})();function k(q){if(typeof q==="string"){q=document.querySelector(q)}if(!q||typeof q!=="object"||!q.nodeType){return}var C=c(q);if(C.display==="none"){return e()}var B={};B.width=q.offsetWidth;B.height=q.offsetHeight;var s=B.isBorderBox=!!(j&&C[j]&&C[j]==="border-box");for(var r=0,u=g.length;r<u;r++){var x=g[r];var F=C[x];F=n(q,F);var y=parseFloat(F);B[x]=!isNaN(y)?y:0}var A=B.paddingLeft+B.paddingRight;var z=B.paddingTop+B.paddingBottom;var w=B.marginLeft+B.marginRight;var v=B.marginTop+B.marginBottom;var p=B.borderLeftWidth+B.borderRightWidth;var o=B.borderTopWidth+B.borderBottomWidth;var t=s&&m;var E=d(C.width);if(E!==false){B.width=E+(t?0:A+p)}var D=d(C.height);if(D!==false){B.height=D+(t?0:z+o)}B.innerWidth=B.width-(A+p);B.innerHeight=B.height-(z+o);B.outerWidth=B.width+w;B.outerHeight=B.height+v;return B}function n(o,t){if(f||t.indexOf("%")===-1){return t}var s=o.style;var p=s.left;var q=o.runtimeStyle;var r=q&&q.left;if(r){q.left=o.currentStyle.left}s.left=t;t=s.pixelLeft;s.left=p;if(r){q.left=r}return t}return k}if(typeof define==="function"&&define.amd){define("get-size/get-size",["get-style-property/get-style-property"],a)}else{i.getSize=a(i.getStyleProperty)}})(window);(function(d,c){var g=(function(){if(c.matchesSelector){return"matchesSelector"}var o=["webkit","moz","ms","o"];for(var k=0,l=o.length;k<l;k++){var n=o[k];var m=n+"MatchesSelector";if(c[m]){return m}}})();function e(k,l){return k[g](l)}function a(k){if(k.parentNode){return}var l=document.createDocumentFragment();l.appendChild(k)}function i(k,o){a(k);var l=k.parentNode.querySelectorAll(o);for(var m=0,n=l.length;m<n;m++){if(l[m]===k){return true}}return false}function f(k,l){a(k);return e(k,l)}var h;if(g){var b=document.createElement("div");var j=e(b,"div");h=j?e:f}else{h=i}if(typeof define==="function"&&define.amd){define("matches-selector/matches-selector",[],function(){return h})}else{window.matchesSelector=h}})(this,Element.prototype);(function(g){var a=document.defaultView;var c=a&&a.getComputedStyle?function(h){return a.getComputedStyle(h,null)}:function(h){return h.currentStyle};function b(h,i){for(var j in i){h[j]=i[j]}return h}function d(h){for(var i in h){return false}i=null;return true}function f(h){return h.replace(/([A-Z])/g,function(i){return"-"+i.toLowerCase()})}function e(j,k,l){var t=l("transition");var r=l("transform");var q=t&&r;var m=!!l("perspective");var s={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[t];var p=["transform","transition","transitionDuration","transitionProperty"];var v=(function(){var w={};for(var x=0,y=p.length;x<y;x++){var z=p[x];var A=l(z);if(A&&A!==z){w[z]=A}}return w})();function n(w,x){if(!w){return}this.element=w;this.layout=x;this.position={x:0,y:0};this._create()}b(n.prototype,j.prototype);n.prototype._create=function(){this._transition={ingProperties:{},clean:{},onEnd:{}};this.css({position:"absolute"})};n.prototype.handleEvent=function(w){var x="on"+w.type;if(this[x]){this[x](w)}};n.prototype.getSize=function(){this.size=k(this.element)};n.prototype.css=function(y){var w=this.element.style;for(var x in y){var z=v[x]||x;w[z]=y[x]}};n.prototype.getPosition=function(){var C=c(this.element);var A=this.layout.options;var w=A.isOriginLeft;var z=A.isOriginTop;var D=parseInt(C[w?"left":"right"],10);var E=parseInt(C[z?"top":"bottom"],10);D=isNaN(D)?0:D;E=isNaN(E)?0:E;var B=this.layout.size;D-=w?B.paddingLeft:B.paddingRight;E-=z?B.paddingTop:B.paddingBottom;this.position.x=D;this.position.y=E};n.prototype.layoutPosition=function(){var x=this.layout.size;var w=this.layout.options;var y={};if(w.isOriginLeft){y.left=(this.position.x+x.paddingLeft)+"px";y.right=""}else{y.right=(this.position.x+x.paddingRight)+"px";y.left=""}if(w.isOriginTop){y.top=(this.position.y+x.paddingTop)+"px";y.bottom=""}else{y.bottom=(this.position.y+x.paddingBottom)+"px";y.top=""}this.css(y);this.emitEvent("layout",[this])};var u=m?function(w,z){return"translate3d("+w+"px, "+z+"px, 0)"}:function(w,z){return"translate("+w+"px, "+z+"px)"};n.prototype._transitionTo=function(H,I){this.getPosition();var A=this.position.x;var B=this.position.y;var w=parseInt(H,10);var z=parseInt(I,10);var C=w===this.position.x&&z===this.position.y;this.setPosition(H,I);if(C&&!this.isTransitioning){this.layoutPosition();return}var F=H-A;var G=I-B;var E={};var D=this.layout.options;F=D.isOriginLeft?F:-F;G=D.isOriginTop?G:-G;E.transform=u(F,G);this.transition({to:E,onTransitionEnd:{transform:this.layoutPosition},isCleaning:true})};n.prototype.goTo=function(w,z){this.setPosition(w,z);this.layoutPosition()};n.prototype.moveTo=q?n.prototype._transitionTo:n.prototype.goTo;n.prototype.setPosition=function(w,z){this.position.x=parseInt(w,10);this.position.y=parseInt(z,10)};n.prototype._nonTransition=function(w){this.css(w.to);if(w.isCleaning){this._removeStyles(w.to)}for(var x in w.onTransitionEnd){w.onTransitionEnd[x].call(this)}};n.prototype._transition=function(x){if(!parseFloat(this.layout.options.transitionDuration)){this._nonTransition(x);return}var w=this._transition;for(var z in x.onTransitionEnd){w.onEnd[z]=x.onTransitionEnd[z]}for(z in x.to){w.ingProperties[z]=true;if(x.isCleaning){w.clean[z]=true}}if(x.from){this.css(x.from);var y=this.element.offsetHeight;y=null}this.enableTransition(x.to);this.css(x.to);this.isTransitioning=true};var o=r&&(f(r)+",opacity");n.prototype.enableTransition=function(){if(this.isTransitioning){return}this.css({transitionProperty:o,transitionDuration:this.layout.options.transitionDuration});this.element.addEventListener(s,this,false)};n.prototype.transition=n.prototype[t?"_transition":"_nonTransition"];n.prototype.onwebkitTransitionEnd=function(w){this.ontransitionend(w)};n.prototype.onotransitionend=function(w){this.ontransitionend(w)};var i={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};n.prototype.ontransitionend=function(x){if(x.target!==this.element){return}var w=this._transition;var z=i[x.propertyName]||x.propertyName;delete w.ingProperties[z];if(d(w.ingProperties)){this.disableTransition()}if(z in w.clean){this.element.style[x.propertyName]="";delete w.clean[z]}if(z in w.onEnd){var y=w.onEnd[z];y.call(this);delete w.onEnd[z]}this.emitEvent("transitionEnd",[this])};n.prototype.disableTransition=function(){this.removeTransitionStyles();this.element.removeEventListener(s,this,false);this.isTransitioning=false};n.prototype._removeStyles=function(y){var w={};for(var x in y){w[x]=""}this.css(w)};var h={transitionProperty:"",transitionDuration:""};n.prototype.removeTransitionStyles=function(){this.css(h)};n.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element);this.emitEvent("remove",[this])};n.prototype.remove=function(){if(!t||!parseFloat(this.layout.options.transitionDuration)){this.removeElem();return}var w=this;this.on("transitionEnd",function(){w.removeElem();return true});this.hide()};n.prototype.reveal=function(){delete this.isHidden;this.css({display:""});var w=this.layout.options;this.transition({from:w.hiddenStyle,to:w.visibleStyle,isCleaning:true})};n.prototype.hide=function(){this.isHidden=true;this.css({display:""});var w=this.layout.options;this.transition({from:w.visibleStyle,to:w.hiddenStyle,isCleaning:true,onTransitionEnd:{opacity:function(){if(this.isHidden){this.css({display:"none"})}}}})};n.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})};return n}if(typeof define==="function"&&define.amd){define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],e)}else{g.Outlayer={};g.Outlayer.Item=e(g.EventEmitter,g.getSize,g.getStyleProperty)}})(window);(function(p){var b=p.document;var a=p.console;var i=p.jQuery;var k=function(){};function c(q,r){for(var s in r){q[s]=r[s]}return q}var l=Object.prototype.toString;function e(q){return l.call(q)==="[object Array]"}function j(t){var q=[];if(e(t)){q=t}else{if(t&&typeof t.length==="number"){for(var r=0,s=t.length;r<s;r++){q.push(t[r])}}else{q.push(t)}}return q}var f=(typeof HTMLElement==="object")?function g(q){return q instanceof HTMLElement}:function h(q){return q&&typeof q==="object"&&q.nodeType===1&&typeof q.nodeName==="string"};var d=Array.prototype.indexOf?function(q,r){return q.indexOf(r)}:function(q,t){for(var r=0,s=q.length;r<s;r++){if(q[r]===t){return r}}return -1};function n(s,q){var r=d(q,s);if(r!==-1){q.splice(r,1)}}function o(q){return q.replace(/(.)([A-Z])/g,function(t,r,s){return r+"-"+s}).toLowerCase()}function m(t,r,s,u,y,x){var v=0;var w={};function z(A,C){if(typeof A==="string"){A=b.querySelector(A)}if(!A||!f(A)){if(a){a.error("Bad "+this.settings.namespace+" element: "+A)}return}this.element=A;this.options=c({},this.options);this.option(C);var B=++v;this.element.outlayerGUID=B;w[B]=this;this._create();if(this.options.isInitLayout){this.layout()}}z.prototype.settings={namespace:"outlayer",item:x};z.prototype.options={containerStyle:{position:"relative"},isInitLayout:true,isOriginLeft:true,isOriginTop:true,isResizeBound:true,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};c(z.prototype,s.prototype);z.prototype.option=function(A){c(this.options,A)};z.prototype._create=function(){this.reloadItems();this.stamps=[];this.stamp(this.options.stamp);c(this.element.style,this.options.containerStyle);if(this.options.isResizeBound){this.bindResize()}};z.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)};z.prototype._itemize=function(B){var F=this._filterFindItemElements(B);var E=this.settings.item;var G=[];for(var C=0,H=F.length;C<H;C++){var A=F[C];var D=new E(A,this);G.push(D)}return G};z.prototype._filterFindItemElements=function(C){C=j(C);var F=this.options.itemSelector;var E=[];for(var D=0,I=C.length;D<I;D++){var B=C[D];if(!f(B)){continue}if(F){if(y(B,F)){E.push(B)}var A=B.querySelectorAll(F);for(var G=0,H=A.length;G<H;G++){E.push(A[G])}}else{E.push(B)}}return E};z.prototype.getItemElements=function(){var A=[];for(var B=0,C=this.items.length;B<C;B++){A.push(this.items[B].element)}return A};z.prototype.layout=function(){this._resetLayout();this._manageStamps();var A=this.options.isLayoutInstant!==undefined?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,A);this._isLayoutInited=true};z.prototype._init=z.prototype.layout;z.prototype._resetLayout=function(){this.getSize()};z.prototype.getSize=function(){this.size=u(this.element)};z.prototype._getMeasurement=function(B,D){var C=this.options[B];var A;if(!C){this[B]=0}else{if(typeof C==="string"){A=this.element.querySelector(C)}else{if(f(C)){A=C}}this[B]=A?u(A)[D]:C}};z.prototype.layoutItems=function(B,A){B=this._getItemsForLayout(B);this._layoutItems(B,A);this._postLayout()};z.prototype._getItemsForLayout=function(C){var D=[];for(var A=0,E=C.length;A<E;A++){var B=C[A];if(!B.isIgnored){D.push(B)}}return D};z.prototype._layoutItems=function(D,B){if(!D||!D.length){this.emitEvent("layoutComplete",[this,D]);return}this._itemsOn(D,"layout",function F(){this.emitEvent("layoutComplete",[this,D])});var H=[];for(var A=0,E=D.length;A<E;A++){var C=D[A];var G=this._getItemLayoutPosition(C);G.item=C;G.isInstant=B;H.push(G)}this._processLayoutQueue(H)};z.prototype._getItemLayoutPosition=function(){return{x:0,y:0}};z.prototype._processLayoutQueue=function(D){for(var A=0,B=D.length;A<B;A++){var C=D[A];this._positionItem(C.item,C.x,C.y,C.isInstant)}};z.prototype._positionItem=function(B,C,D,A){if(A){B.goTo(C,D)}else{B.moveTo(C,D)}};z.prototype._postLayout=function(){var A=this._getContainerSize();if(A){this._setContainerMeasure(A.width,true);this._setContainerMeasure(A.height,false)}};z.prototype._getContainerSize=k;z.prototype._setContainerMeasure=function(C,B){if(C===undefined){return}var A=this.size;if(A.isBorderBox){C+=B?A.paddingLeft+A.paddingRight+A.borderLeftWidth+A.borderRightWidth:A.paddingBottom+A.paddingTop+A.borderTopWidth+A.borderBottomWidth}C=Math.max(C,0);this.element.style[B?"width":"height"]=C+"px"};z.prototype._itemsOn=function(H,E,B){var D=0;var C=H.length;var A=this;function J(){D++;if(D===C){B.call(A)}return true}for(var F=0,I=H.length;F<I;F++){var G=H[F];G.on(E,J)}};z.prototype.ignore=function(A){var B=this.getItem(A);if(B){B.isIgnored=true}};z.prototype.unignore=function(A){var B=this.getItem(A);if(B){delete B.isIgnored}};z.prototype.stamp=function(B){B=this._find(B);if(!B){return}this.stamps=this.stamps.concat(B);for(var C=0,D=B.length;C<D;C++){var A=B[C];this.ignore(A)}};z.prototype.unstamp=function(B){B=this._find(B);if(!B){return}for(var C=0,D=B.length;C<D;C++){var A=B[C];n(A,this.stamps);this.unignore(A)}};z.prototype._find=function(A){if(!A){return}if(typeof A==="string"){A=this.element.querySelectorAll(A)}A=j(A);return A};z.prototype._manageStamps=function(){if(!this.stamps||!this.stamps.length){return}this._getBoundingRect();for(var A=0,B=this.stamps.length;A<B;A++){var C=this.stamps[A];this._manageStamp(C)}};z.prototype._getBoundingRect=function(){var A=this.element.getBoundingClientRect();var B=this.size;this._boundingRect={left:A.left+B.paddingLeft+B.borderLeftWidth,top:A.top+B.paddingTop+B.borderTopWidth,right:A.right-(B.paddingRight+B.borderRightWidth),bottom:A.bottom-(B.paddingBottom+B.borderBottomWidth)}};z.prototype._manageStamp=k;z.prototype._getElementOffset=function(B){var A=B.getBoundingClientRect();var E=this._boundingRect;var D=u(B);var C={left:A.left-E.left-D.marginLeft,top:A.top-E.top-D.marginTop,right:E.right-A.right-D.marginRight,bottom:E.bottom-A.bottom-D.marginBottom};return C};z.prototype.handleEvent=function(A){var B="on"+A.type;if(this[B]){this[B](A)}};z.prototype.bindResize=function(){if(this.isResizeBound){return}t.bind(p,"resize",this);this.isResizeBound=true};z.prototype.unbindResize=function(){t.unbind(p,"resize",this);this.isResizeBound=false};z.prototype.onresize=function(){if(this.resizeTimeout){clearTimeout(this.resizeTimeout)}var A=this;function B(){A.resize();delete A.resizeTimeout}this.resizeTimeout=setTimeout(B,100)};z.prototype.resize=function(){var B=u(this.element);var A=this.size&&B;if(A&&B.innerWidth===this.size.innerWidth){return}this.layout()};z.prototype.addItems=function(A){var B=this._itemize(A);if(B.length){this.items=this.items.concat(B)}return B};z.prototype.appended=function(A){var B=this.addItems(A);if(!B.length){return}this.layoutItems(B,true);this.reveal(B)};z.prototype.prepended=function(A){var B=this._itemize(A);if(!B.length){return}var C=this.items.slice(0);this.items=B.concat(C);this._resetLayout();this._manageStamps();this.layoutItems(B,true);this.reveal(B);this.layoutItems(C)};z.prototype.reveal=function(C){if(!C||!C.length){return}for(var A=0,D=C.length;A<D;A++){var B=C[A];B.reveal()}};z.prototype.hide=function(C){if(!C||!C.length){return}for(var A=0,D=C.length;A<D;A++){var B=C[A];B.hide()}};z.prototype.getItem=function(A){for(var B=0,D=this.items.length;B<D;B++){var C=this.items[B];if(C.element===A){return C}}};z.prototype.getItems=function(B){if(!B||!B.length){return}var E=[];for(var C=0,F=B.length;C<F;C++){var A=B[C];var D=this.getItem(A);if(D){E.push(D)}}return E};z.prototype.remove=function(A){A=j(A);var E=this.getItems(A);if(!E||!E.length){return}this._itemsOn(E,"remove",function(){this.emitEvent("removeComplete",[this,E])});for(var B=0,D=E.length;B<D;B++){var C=E[B];C.remove();n(C,this.items)}};z.prototype.destroy=function(){var D=this.element.style;D.height="";D.position="";D.width="";for(var A=0,C=this.items.length;A<C;A++){var B=this.items[A];B.destroy()}this.unbindResize();delete this.element.outlayerGUID;if(i){i.removeData(this.element,this.settings.namespace)}};z.data=function(A){var B=A&&A.outlayerGUID;return B&&w[B]};function q(A,B){A.prototype[B]=c({},z.prototype[B])}z.create=function(C,D){function A(){z.apply(this,arguments)}c(A.prototype,z.prototype);q(A,"options");q(A,"settings");c(A.prototype.options,D);A.prototype.settings.namespace=C;A.data=z.data;A.Item=function B(){x.apply(this,arguments)};A.Item.prototype=new x();A.prototype.settings.item=A.Item;r(function(){var F=o(C);var I=b.querySelectorAll(".js-"+F);var G="data-"+F+"-options";for(var K=0,M=I.length;K<M;K++){var H=I[K];var E=H.getAttribute(G);var N;try{N=E&&JSON.parse(E)}catch(J){if(a){a.error("Error parsing "+G+" on "+H.nodeName.toLowerCase()+(H.id?"#"+H.id:"")+": "+J)}continue}var L=new A(H,N);if(i){i.data(H,C,L)}}});if(i&&i.bridget){i.bridget(C,A)}return A};z.Item=x;return z}if(typeof define==="function"&&define.amd){define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],m)}else{p.Outlayer=m(p.eventie,p.docReady,p.EventEmitter,p.getSize,p.matchesSelector,p.Outlayer.Item)}})(window);(function(c){var a=Array.prototype.indexOf?function(d,e){return d.indexOf(e)}:function(f,h){for(var d=0,g=f.length;d<g;d++){var e=f[d];if(e===h){return d}}return -1};function b(f,d){var e=f.create("masonry");e.prototype._resetLayout=function(){this.getSize();this._getMeasurement("columnWidth","outerWidth");this._getMeasurement("gutter","outerWidth");this.measureColumns();var g=this.cols;this.colYs=[];while(g--){this.colYs.push(0)}this.maxY=0};e.prototype.measureColumns=function(){this.getContainerWidth();if(!this.columnWidth){var g=this.items[0];var h=g&&g.element;this.columnWidth=h&&d(h).outerWidth||this.containerWidth}this.columnWidth+=this.gutter;this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth);this.cols=Math.max(this.cols,1)};e.prototype.getContainerWidth=function(){var g=this.options.isFitWidth?this.element.parentNode:this.element;var h=d(g);this.containerWidth=h&&h.innerWidth};e.prototype._getItemLayoutPosition=function(k){k.getSize();var o=k.size.outerWidth%this.columnWidth;var l=o&&o<1?"round":"ceil";var h=Math[l](k.size.outerWidth/this.columnWidth);h=Math.min(h,this.cols);var g=this._getColGroup(h);var m=Math.min.apply(Math,g);var r=a(g,m);var n={x:this.columnWidth*r,y:m};var p=m+k.size.outerHeight;var q=this.cols+1-g.length;for(var j=0;j<q;j++){this.colYs[r+j]=p}return n};e.prototype._getColGroup=function(h){if(h<2){return this.colYs}var g=[];var k=this.cols+1-h;for(var l=0;l<k;l++){var j=this.colYs.slice(l,l+h);g[l]=Math.max.apply(Math,j)}return g};e.prototype._manageStamp=function(n){var p=d(n);var m=this._getElementOffset(n);var h=this.options.isOriginLeft?m.left:m.right;var l=h+p.outerWidth;var g=Math.floor(h/this.columnWidth);g=Math.max(0,g);var k=Math.floor(l/this.columnWidth);k=Math.min(this.cols-1,k);var o=(this.options.isOriginTop?m.top:m.bottom)+p.outerHeight;for(var j=g;j<=k;j++){this.colYs[j]=Math.max(o,this.colYs[j])}};e.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var g={height:this.maxY};if(this.options.isFitWidth){g.width=this._getContainerFitWidth()}return g};e.prototype._getContainerFitWidth=function(){var h=0;var g=this.cols;while(--g){if(this.colYs[g]!==0){break}h++}return(this.cols-h)*this.columnWidth-this.gutter};e.prototype.resize=function(){var g=this.containerWidth;this.getContainerWidth();if(g===this.containerWidth){return}this.layout()};return e}if(typeof define==="function"&&define.amd){define(["outlayer/outlayer","get-size/get-size"],b)}else{c.Masonry=b(c.Outlayer,c.getSize)}})(window);

Callers 7

aFunction · 0.70
kFunction · 0.70
eFunction · 0.70
nFunction · 0.70
bFunction · 0.70
plugins.jsFile · 0.70

Calls 1

hFunction · 0.70

Tested by

no test coverage detected