bricklayer
Advanced tools
Comparing version 0.2.13 to 0.2.14
@@ -25,3 +25,3 @@ { | ||
], | ||
"version": "0.2.13" | ||
"version": "0.2.14" | ||
} |
@@ -178,3 +178,3 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
window["Bricklayer"] = Bricklayer.Container; | ||
if (jQuery !== undefined) { | ||
if (window['jQuery'] !== undefined) { | ||
(function ($) { | ||
@@ -188,5 +188,5 @@ $.fn.bricklayer = function (options) { | ||
}; | ||
})(jQuery); | ||
})(window['jQuery']); | ||
} | ||
},{}]},{},[1]); |
@@ -1,1 +0,1 @@ | ||
!function t(e,n,r){function i(s,u){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!u&&l)return l(s,!0);if(o)return o(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){var r,i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};!function(t){function e(t){return[].slice.call(t)}function n(t,e,n){if(window.CustomEvent)var r=new CustomEvent(e,{detail:n});else{var r=document.createEvent("CustomEvent");r.initCustomEvent(e,!0,!0,n)}return t.dispatchEvent(r)}var r={rulerClassName:"bricklayer-column-sizer",columnClassName:"bricklayer-column"},o=function(){function t(t){this.element=document.createElement("div"),this.element.className=t}return t}(),s=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.getWidth=function(){this.element.setAttribute("style","\n display: block;\n visibility: hidden !important;\n top: -1000px !important;\n ");var t=this.element.offsetWidth;return this.element.removeAttribute("style"),t},e}(o),u=function(t){function e(){t.apply(this,arguments)}return i(e,t),e}(o),l=function(){function t(t,e){void 0===e&&(e=r),this.element=t,this.options=e,this.ruler=new s(e.rulerClassName),this.build(),this.buildResponsive()}return t.prototype.append=function(t){var n=this;if(Array.isArray(t))return void t.forEach(function(t){return n.append(t)});var r=this.findMinHeightColumn();this.elements=e(this.elements).concat([t]),this.applyPosition("append",r,t)},t.prototype.prepend=function(t){var n=this;if(Array.isArray(t))return void t.forEach(function(t){return n.prepend(t)});var r=this.findMinHeightColumn();this.elements=[t].concat(e(this.elements)),this.applyPosition("prepend",r,t)},t.prototype.on=function(t,e){return this.element.addEventListener("bricklayer."+t,e),this},t.prototype.build=function(){this.elements=this.getElementsInOrder(),this.element.insertBefore(this.ruler.element,this.element.firstChild)},t.prototype.buildResponsive=function(){var t=this;window.addEventListener("resize",function(e){return t.checkColumnCount()}),this.checkColumnCount(),this.on("breakpoint",function(e){return t.reorderElements(e.detail.columnCount)}),this.columnCount>=1&&this.reorderElements(this.columnCount)},t.prototype.getColumns=function(){return this.element.querySelectorAll(":scope > ."+this.options.columnClassName)},t.prototype.findMinHeightColumn=function(){var t=this.getColumns(),n=e(t).sort(function(t,e){var n=t.offsetHeight,r=e.offsetHeight;return n>r?1:n==r?0:-1});return n[0]},t.prototype.getElementsInOrder=function(){return this.element.querySelectorAll(":scope > *:not(."+this.options.columnClassName+"):not(."+this.options.rulerClassName+")")},t.prototype.checkColumnCount=function(){var t=this.getColumnCount();this.columnCount!==t&&(n(this.element,"bricklayer.breakpoint",{columnCount:t}),this.columnCount=t)},t.prototype.reorderElements=function(t){var n=this;void 0===t&&(t=1),(t==1/0||1>t)&&(t=1);for(var r=e(this.elements).map(function(t){var e=t.parentNode?t.parentNode.removeChild(t):t;return e}),i=this.getColumns(),o=0;o<i.length;o++)i[o].parentNode.removeChild(i[o]);for(var o=0;t>o;o++){var s=new u(this.options.columnClassName).element;this.element.appendChild(s)}r.forEach(function(t){var e=n.findMinHeightColumn();e.appendChild(t)})},t.prototype.getColumnCount=function(){var t=this.element.offsetWidth,e=this.ruler.getWidth();return Math.round(t/e)},t.prototype.applyPosition=function(t,e,r){var i=this,o=function(o){var s=o+t.charAt(0).toUpperCase()+t.substr(1);n(i.element,"bricklayer."+s,{item:r,column:e})};switch(o("before"),t){case"append":e.appendChild(r);break;case"prepend":e.insertBefore(r,e.firstChild)}o("after")},t}();t.Container=l}(r||(r={})),window.Bricklayer=r.Container,void 0!==jQuery&&!function(t){t.fn.bricklayer=function(e){return t(this).forEach(function(){var n=new r.Container(this,e);t(this).data("bricklayer",n)}),this}}(jQuery)},{}]},{},[1]); | ||
!function t(e,n,r){function i(s,u){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!u&&l)return l(s,!0);if(o)return o(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){var r,i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};!function(t){function e(t){return[].slice.call(t)}function n(t,e,n){if(window.CustomEvent)var r=new CustomEvent(e,{detail:n});else{var r=document.createEvent("CustomEvent");r.initCustomEvent(e,!0,!0,n)}return t.dispatchEvent(r)}var r={rulerClassName:"bricklayer-column-sizer",columnClassName:"bricklayer-column"},o=function(){function t(t){this.element=document.createElement("div"),this.element.className=t}return t}(),s=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.getWidth=function(){this.element.setAttribute("style","\n display: block;\n visibility: hidden !important;\n top: -1000px !important;\n ");var t=this.element.offsetWidth;return this.element.removeAttribute("style"),t},e}(o),u=function(t){function e(){t.apply(this,arguments)}return i(e,t),e}(o),l=function(){function t(t,e){void 0===e&&(e=r),this.element=t,this.options=e,this.ruler=new s(e.rulerClassName),this.build(),this.buildResponsive()}return t.prototype.append=function(t){var n=this;if(Array.isArray(t))return void t.forEach(function(t){return n.append(t)});var r=this.findMinHeightColumn();this.elements=e(this.elements).concat([t]),this.applyPosition("append",r,t)},t.prototype.prepend=function(t){var n=this;if(Array.isArray(t))return void t.forEach(function(t){return n.prepend(t)});var r=this.findMinHeightColumn();this.elements=[t].concat(e(this.elements)),this.applyPosition("prepend",r,t)},t.prototype.on=function(t,e){return this.element.addEventListener("bricklayer."+t,e),this},t.prototype.build=function(){this.elements=this.getElementsInOrder(),this.element.insertBefore(this.ruler.element,this.element.firstChild)},t.prototype.buildResponsive=function(){var t=this;window.addEventListener("resize",function(e){return t.checkColumnCount()}),this.checkColumnCount(),this.on("breakpoint",function(e){return t.reorderElements(e.detail.columnCount)}),this.columnCount>=1&&this.reorderElements(this.columnCount)},t.prototype.getColumns=function(){return this.element.querySelectorAll(":scope > ."+this.options.columnClassName)},t.prototype.findMinHeightColumn=function(){var t=this.getColumns(),n=e(t).sort(function(t,e){var n=t.offsetHeight,r=e.offsetHeight;return n>r?1:n==r?0:-1});return n[0]},t.prototype.getElementsInOrder=function(){return this.element.querySelectorAll(":scope > *:not(."+this.options.columnClassName+"):not(."+this.options.rulerClassName+")")},t.prototype.checkColumnCount=function(){var t=this.getColumnCount();this.columnCount!==t&&(n(this.element,"bricklayer.breakpoint",{columnCount:t}),this.columnCount=t)},t.prototype.reorderElements=function(t){var n=this;void 0===t&&(t=1),(t==1/0||1>t)&&(t=1);for(var r=e(this.elements).map(function(t){var e=t.parentNode?t.parentNode.removeChild(t):t;return e}),i=this.getColumns(),o=0;o<i.length;o++)i[o].parentNode.removeChild(i[o]);for(var o=0;t>o;o++){var s=new u(this.options.columnClassName).element;this.element.appendChild(s)}r.forEach(function(t){var e=n.findMinHeightColumn();e.appendChild(t)})},t.prototype.getColumnCount=function(){var t=this.element.offsetWidth,e=this.ruler.getWidth();return Math.round(t/e)},t.prototype.applyPosition=function(t,e,r){var i=this,o=function(o){var s=o+t.charAt(0).toUpperCase()+t.substr(1);n(i.element,"bricklayer."+s,{item:r,column:e})};switch(o("before"),t){case"append":e.appendChild(r);break;case"prepend":e.insertBefore(r,e.firstChild)}o("after")},t}();t.Container=l}(r||(r={})),window.Bricklayer=r.Container,void 0!==window.jQuery&&!function(t){t.fn.bricklayer=function(e){return t(this).forEach(function(){var n=new r.Container(this,e);t(this).data("bricklayer",n)}),this}}(window.jQuery)},{}]},{},[1]); |
{ | ||
"name": "bricklayer", | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "Lightweight and strong Masonry alternative", | ||
@@ -5,0 +5,0 @@ "main": "dist/bricklayer.js", |
@@ -190,3 +190,3 @@ interface IOptions { | ||
if (jQuery !== undefined) { | ||
if (window['jQuery'] !== undefined) { | ||
(function ($) { | ||
@@ -200,3 +200,3 @@ $.fn.bricklayer = function (options) { | ||
} | ||
})(jQuery) | ||
})(window['jQuery']) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2200118