Skip to content

Commit

Permalink
Added replacement ratio condition and an option to activate it
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasblomdin committed Dec 7, 2012
1 parent bd1a617 commit 50d5151
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jquery.nested.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jQuery.fn.reverse = [].reverse;
minColumns: 1,
gutter: 1,
resizeToFit: true,
resizeUpscale: true,
animate: false,
animationOptions: {
speed: 100,
Expand Down Expand Up @@ -224,12 +225,11 @@ jQuery.fn.reverse = [].reverse;

} else if (box.ready) {
$.each(arr, function (i, el) {
if (arr[i]['y'] == topY && box.y < arr[i]['y']) {
el = el['$el'];
$(el).addClass('nested-moved');
item = arr.splice(i, 1);
if (box.y <= arr[i]['y'] && (self.options.resizeUpscale || box.w <= arr[i]['width'] && box.h <= arr[i]['height'])) {
arr.splice(i, 1);
$(el['$el']).addClass('nested-moved');
self.elements.push({
$el: $(el),
$el: $(el['$el']),
x: parseInt(box.x) + self.box.offset().left,
y: parseInt(box.y) + self.box.offset().top,
width: parseInt(box.w),
Expand Down

0 comments on commit 50d5151

Please sign in to comment.