Skip to content

Commit 442f45a

Browse files
Merge pull request #1 from hhff/feature/allow-images-to-be-deeply-nested
Allow Images to be nested at any depth
2 parents 79a3713 + 9ec36e5 commit 442f45a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

js/magic.rows.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
this.css({
1414
'font-size': 0,
1515
'text-align': 'justify'
16-
}).children().css({
16+
}).find('*:not(img)').css({
1717
'display': 'inline-block'
1818
}).find('img').css({
1919
'display':'block'
@@ -37,7 +37,8 @@
3737
// settings
3838
var settings = $.extend({
3939
max_height: 225,
40-
margin: 6
40+
margin: 6,
41+
selector: this.selector
4142
}, options);
4243

4344

@@ -55,7 +56,7 @@
5556
var image = {
5657
aspect_ratio: $this.width() / $this.height(),
5758
height: $this.height(),
58-
index: $this.parent().index(),
59+
index: $this.parentsUntil(settings.selector).last().index(),
5960
width: $this.width()
6061
};
6162
images_array.push(image);
@@ -160,4 +161,4 @@
160161

161162
};
162163

163-
})( window, jQuery);
164+
})( window, jQuery);

0 commit comments

Comments
 (0)