Skip to content
Permalink
Browse files

Dialog: Changed height measurement to hide content because IE quirks …

…mode ignores height: 0 (Fixed #4350 No Scrollbars in IE in Quirksmode)
  • Loading branch information
btburnett3 committed Feb 22, 2010
1 parent a874748 commit e2202847c6a8837bb732cc21401915b82e433c50
Showing with 46 additions and 7 deletions.
  1. +39 −0 tests/visual/dialog/dialog_ticket_4350.html
  2. +7 −7 ui/jquery.ui.dialog.js
@@ -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>
@@ -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()));

0 comments on commit e220284

Please sign in to comment.
You can’t perform that action at this time.