mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
accordion: Fix for #4695
This commit is contained in:
parent
e132c1b363
commit
417d5b29b4
@ -56,6 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="navigationWrapper">
|
||||||
<ul id="navigation">
|
<ul id="navigation">
|
||||||
<li>
|
<li>
|
||||||
<h2><a href="?p=1.1.1">Guitar</a></h2>
|
<h2><a href="?p=1.1.1">Guitar</a></h2>
|
||||||
@ -88,6 +89,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -112,11 +112,19 @@ test("{ event: 'mouseover' }", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("{ fillSpace: false }, default", function() {
|
test("{ fillSpace: false }, default", function() {
|
||||||
ok(false, 'missing test - untested code is broken code');
|
$("#navigationWrapper").height(500);
|
||||||
|
$('#navigation').accordion({ fillSpace: false });
|
||||||
|
equals( $('#navigation > li:eq(0) > ul').height(), 126 );
|
||||||
|
equals( $('#navigation > li:eq(1) > ul').height(), 126 );
|
||||||
|
equals( $('#navigation > li:eq(2) > ul').height(), 126 );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("{ fillSpace: true }", function() {
|
test("{ fillSpace: true }", function() {
|
||||||
ok(false, 'missing test - untested code is broken code');
|
$("#navigationWrapper").height(500);
|
||||||
|
$('#navigation').accordion({ fillSpace: true });
|
||||||
|
equals( $('#navigation > li:eq(0) > ul').height(), 386 );
|
||||||
|
equals( $('#navigation > li:eq(1) > ul').height(), 386 );
|
||||||
|
equals( $('#navigation > li:eq(2) > ul').height(), 386 );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("{ header: '> li > :first-child,> :not(li):even' }, default", function() {
|
test("{ header: '> li > :first-child,> :not(li):even' }, default", function() {
|
||||||
|
@ -20,11 +20,11 @@
|
|||||||
<div style="height: 500px; width: 500px; border: 1px solid red;">
|
<div style="height: 500px; width: 500px; border: 1px solid red;">
|
||||||
<div id="accordion" style="width:490px;">
|
<div id="accordion" style="width:490px;">
|
||||||
<h3><a href="#">Accordion Header 1</a></h3>
|
<h3><a href="#">Accordion Header 1</a></h3>
|
||||||
<div>
|
<div style="padding-top: 1em">
|
||||||
Accordion Content 1
|
Accordion Content 1
|
||||||
</div>
|
</div>
|
||||||
<h3><a href="#">Accordion Header 2</a></h3>
|
<h3><a href="#">Accordion Header 2</a></h3>
|
||||||
<div>
|
<div style="padding-top: 3em">
|
||||||
Accordion Content 2
|
Accordion Content 2
|
||||||
<p>paragraph</p>
|
<p>paragraph</p>
|
||||||
<p>paragraph</p>
|
<p>paragraph</p>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<p>paragraph</p>
|
<p>paragraph</p>
|
||||||
</div>
|
</div>
|
||||||
<h3><a href="#">Accordion Header 3</a></h3>
|
<h3><a href="#">Accordion Header 3</a></h3>
|
||||||
<div>
|
<div style="padding-top: 0">
|
||||||
Accordion Content 3
|
Accordion Content 3
|
||||||
<ul>
|
<ul>
|
||||||
<li>list item</li>
|
<li>list item</li>
|
||||||
|
@ -216,11 +216,10 @@ $.widget("ui.accordion", {
|
|||||||
maxHeight -= $(this).outerHeight(true);
|
maxHeight -= $(this).outerHeight(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
var maxPadding = 0;
|
|
||||||
this.headers.next().each(function() {
|
this.headers.next().each(function() {
|
||||||
maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
|
var padding = $(this).innerHeight() - $(this).height();
|
||||||
}).height(Math.max(0, maxHeight - maxPadding))
|
$(this).height(Math.max(0, maxHeight - padding));
|
||||||
.css('overflow', 'auto');
|
}).css('overflow', 'auto');
|
||||||
|
|
||||||
} else if ( o.autoHeight ) {
|
} else if ( o.autoHeight ) {
|
||||||
maxHeight = 0;
|
maxHeight = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user