Permalink
Browse files

added comment + minimized version

  • Loading branch information...
archiloque committed Apr 22, 2012
1 parent ec1f38c commit d834cc3e5f5ebb82123a93cb14c26f93d53dc34e
Showing with 21 additions and 2 deletions.
  1. +3 −0 compact.sh
  2. +10 −2 jquery.compactWall.js
  3. +8 −0 jquery.compactWall.min.js
View
@@ -0,0 +1,3 @@
+# uglify jquery.compactWall.js to jquery.compactWall.min.js
+# requires UglifyJS from https://github.com/mishoo/UglifyJS
+uglifyjs jquery.compactWall.js > jquery.compactWall.min.js
View
@@ -1,5 +1,5 @@
/**
- * jQuery CompactWall v2.1.04
+ * jQuery CompactWall v0.0.1
* A jQuery plugin to organizes blocks in a compact way.
* http://github.com/archiloque/compact-wall
*
@@ -176,7 +176,9 @@
return bestFitInternal(blocksList, position, Number.POSITIVE_INFINITY);
};
-
+ /**
+ * Internal version of bestFit.
+ */
var bestFitInternal = function (remainingBlocks, position, maxHeight) {
if (remainingBlocks.length == 1) {
return bestFitLastBlock(remainingBlocks[0], position, maxHeight);
@@ -194,6 +196,9 @@
}
};
+ /**
+ * Find the best fitting position when adding the last block.
+ */
var bestFitLastBlock = function (remainingBlock, position, maxHeight) {
var bestPosition = null;
var minHeight = maxHeight;
@@ -206,6 +211,9 @@
return bestPosition;
};
+ /**
+ * Find the best fitting position when adding a block to a position
+ */
var nextFitNextBlock = function (remainingBlocks, block, index, position, maxHeight) {
var bestPosition = null;
var minHeight = maxHeight;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit d834cc3

Please sign in to comment.