Dialog: Changed height measurement to hide content because IE quirks mode ignores height: 0 (Fixed #4350 No Scrollbars in IE in Quirksmode)

This commit is contained in:
Brant Burnett 2010-02-22 17:37:08 +00:00
parent a8747488d0
commit e2202847c6
2 changed files with 46 additions and 7 deletions

View File

@ -0,0 +1,39 @@
<html lang="en">
<head>
<title>Dialog Visual Test : Dialog option modal true</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../../external/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.dialog.js"></script>
<script type="text/javascript">
$(function() {
$("#dialog").dialog({
height: 200
});
});
</script>
</head>
<body>
<input />
<div id="dialog" title="Dialog Title">
foo<p/>
foo<p/>
foo<p/>
foo<p/>
foo<p/>
foo<p/>
foo<p/>
foo<p/>
foo<p/>
foo<p/>
</div>
</body>
</html>

View File

@ -547,11 +547,9 @@ $.widget("ui.dialog", {
var options = this.options;
// reset content sizing
this.element.css({
height: 0,
minHeight: 0,
width: 'auto'
});
// hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350)
this.element.css('width', 'auto')
.hide();
// reset wrapper sizing
// determine the height of all the non-content elements
@ -567,8 +565,10 @@ $.widget("ui.dialog", {
height: 'auto'
}
: {
height: Math.max(options.height - nonContentHeight, 0)
});
minHeight: 0,
height: Math.max(options.height - nonContentHeight, 0)
})
.show();
(this.uiDialog.is(':data(resizable)') &&
this.uiDialog.resizable('option', 'minHeight', this._minHeight()));