diff options
author | Scott González <scott.gonzalez@gmail.com> | 2008-12-21 16:54:27 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2008-12-21 16:54:27 +0000 |
commit | 8fc17c78f725b249ad6cc9a77150e888299fb08f (patch) | |
tree | de85a4cd225c1e71ef86a5caa9cbd1fc3a691546 | |
parent | 0a716a008e9e0d36f9eec7a37015fb17f08f7ced (diff) | |
download | jquery-ui-8fc17c78f725b249ad6cc9a77150e888299fb08f.tar.gz jquery-ui-8fc17c78f725b249ad6cc9a77150e888299fb08f.zip |
Dialog: Fixed #3145: Added support for height: 'auto'.
-rw-r--r-- | ui/ui.dialog.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index 8fb5ae5e3..7a7175fad 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -411,27 +411,31 @@ $.widget("ui.dialog", { $.widget.prototype._setData.apply(this, arguments); }, - + _size: function() { /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - * divs will both have width and height set + * divs will both have width and height set, so we need to reset them */ + var options = this.options; // reset content sizing this.element.css({ height: 0, width: 'auto' }); - - // reset the wrapper sizing and determine the height of all of the - // non-content elements + + // reset wrapper sizing + // determine the height of all the non-content elements var nonContentHeight = this.uiDialog.css({ height: 'auto', - width: this.options.width + width: options.width }) .height(); - - this.element.height(this.options.height - nonContentHeight); + + this.element.height( + options.height == 'auto' + ? 'auto' + : options.height - nonContentHeight); } }); |