Skip to content

Commit

Permalink
Merge branch 'floatingcontents' of https://github.com/jorrit/jquery-m…
Browse files Browse the repository at this point in the history
…atch-height into jorrit-floatingcontents

Conflicts:
	jquery.matchHeight.js
  • Loading branch information
liabru committed Oct 17, 2015
2 parents a7d35dc + 8844acb commit 89b74a7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
3 changes: 2 additions & 1 deletion jquery.matchHeight.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@
'margin-bottom': '0',
'border-top-width': '0',
'border-bottom-width': '0',
'height': '100px'
'height': '100px',
'overflow': 'hidden'
});
});

Expand Down
16 changes: 16 additions & 0 deletions test/page/test.css
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,20 @@ a.test-summary.has-failed {
display: inline-flex;
vertical-align: top;
float: none;
}

/* test items-with-float */

.items-with-float .item-0 {
float: none;
width: auto;
}

.items-with-float .item-0 .float-element {
display: inline-block;
float: left;
width: 150px;
height: 150px;
margin: 0 20px 12px 0;
background: #EB6841;
}
27 changes: 27 additions & 0 deletions test/page/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,33 @@ <h3>Target</h3>
</div>
</div>
</div>

<div class="items-container items-with-float">
<div class="item item-0">
<div class="float-element"></div>
<h3>Floating element</h3>
<p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam.</p>
<p>Aenean semper felis ipsum, vulputate consequat dui elementum vel.</p>
<p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam. Nunc sollicitudin felis ut pellentesque fermentum. In erat mi, pulvinar sit amet tincidunt vitae, gravida id felis. Phasellus hendrerit erat sed porta imperdiet. Vivamus viverra ipsum tortor, et congue mauris porttitor ut.</p>
<p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam. Nunc sollicitudin felis ut pellentesque fermentum. In erat mi, pulvinar sit amet tincidunt vitae, gravida id felis.</p>
</div>
<div class="item item-1">
<h3>Lorem ipsum dolor</h3>
<p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam. Nunc sollicitudin felis ut pellentesque fermentum. In erat mi, pulvinar sit amet tincidunt vitae, gravida id felis.</p>
</div>
<div class="item item-2">
<h3>Lorem ipsum dolor</h3>
<p>Aenean semper felis ipsum, vulputate consequat dui elementum vel.</p>
</div>
<div class="item item-3">
<h3>Lorem ipsum dolor</h3>
<p>Aenean semper felis ipsum, vulputate consequat dui elementum vel. Nullam odio eros, sagittis vitae lectus id, pretium viverra lectus. Etiam auctor dolor non dui ultricies pulvinar.</p>
</div>
<div class="item item-4">
<h3>Lorem ipsum dolor</h3>
<p>Phasellus ut nibh fermentum, vulputate urna vel, semper diam.</p>
</div>
</div>
</div>
<div id='results'></div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions test/specs/matchHeight.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('matchHeight', function() {

it('has matched heights when byRow true', function(done) {
$('.simple-items, .image-items, .nested-items-parent, .nested-items,' +
'.fixed-items, .inline-block-items, .inline-flex-items')
'.fixed-items, .inline-block-items, .inline-flex-items, .items-with-float')
.each(function() {
var $items = $(this).children('.item'),
rows = $.fn.matchHeight._rows($items);
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('matchHeight', function() {
$.fn.matchHeight._update();

$('.simple-items, .image-items,' +
'.fixed-items, .inline-block-items, .inline-flex-items')
'.fixed-items, .inline-block-items, .inline-flex-items, .items-with-float')
.each(function() {
var $items = $(this).children('.item'),
targetHeight = $items.first().outerHeight(),
Expand Down

0 comments on commit 89b74a7

Please sign in to comment.