Permalink
Browse files

refactored

  • Loading branch information...
e-oj committed Dec 27, 2018
1 parent 165eca7 commit 9b722506d6d9c0b251507bb5cb5f1281ab5777f3
Showing with 19 additions and 16 deletions.
  1. +1 −1 README.md
  2. +6 −5 dist/magic-grid.cjs.js
  3. +6 −5 dist/magic-grid.esm.js
  4. +6 −5 src/index.js
@@ -111,7 +111,7 @@ let magicGrid = new MagicGrid({
items: 30, // Required for dynamic content. Initial number of items in the container.
gutter: 30, // Optional. Space between items. Default: 25(px).
maxColumns: 5, // Maximum number of columns. Default: Infinite.
useMin: true, // Append next element to the shortest column. Default: false.
useMin: true, // Prioritize shorter columns when placing items in the grid. Default: false.
animate: true, // Animate item positioning. Default: false.
});
```
@@ -156,9 +156,10 @@ MagicGrid.prototype.nextCol = function nextCol (cols, i) {
};

/**
* Position each items in the container
* based on their corresponding columns
* values.
* Positions each item in the grid, based
* on their corresponding column's height
* and index then stretches the container to
* the height of the grid.
*/
MagicGrid.prototype.positionItems = function positionItems () {
var ref = this.setup();
@@ -189,10 +190,10 @@ MagicGrid.prototype.positionItems = function positionItems () {
};

/**
* Checks if every items has been loaded
* Checks if every item has been loaded
* in the dom.
*
* @return {Boolean} true if every items is present
* @return {Boolean} true if every item is present
*/
MagicGrid.prototype.ready = function ready () {
if (this.static) { return true; }
@@ -154,9 +154,10 @@ MagicGrid.prototype.nextCol = function nextCol (cols, i) {
};

/**
* Position each items in the container
* based on their corresponding columns
* values.
* Positions each item in the grid, based
* on their corresponding column's height
* and index then stretches the container to
* the height of the grid.
*/
MagicGrid.prototype.positionItems = function positionItems () {
var ref = this.setup();
@@ -187,10 +188,10 @@ MagicGrid.prototype.positionItems = function positionItems () {
};

/**
* Checks if every items has been loaded
* Checks if every item has been loaded
* in the dom.
*
* @return {Boolean} true if every items is present
* @return {Boolean} true if every item is present
*/
MagicGrid.prototype.ready = function ready () {
if (this.static) { return true; }
@@ -118,9 +118,10 @@ class MagicGrid {
}

/**
* Position each items in the container
* based on their corresponding columns
* values.
* Positions each item in the grid, based
* on their corresponding column's height
* and index then stretches the container to
* the height of the grid.
*/
positionItems () {
let { cols, wSpace } = this.setup();
@@ -149,10 +150,10 @@ class MagicGrid {
}

/**
* Checks if every items has been loaded
* Checks if every item has been loaded
* in the dom.
*
* @return {Boolean} true if every items is present
* @return {Boolean} true if every item is present
*/
ready () {
if (this.static) return true;

0 comments on commit 9b72250

Please sign in to comment.