Skip to main content

Search and Top Navigation

Ticket #3145: dialog-height-auto-r1184.patch


File dialog-height-auto-r1184.patch, 1.3 KB (added by scottgonzalez, December 20, 2008 04:14PM UTC)
Index: /Users/sgonzale/Documents/workspace/jQuery UI/ui/ui.dialog.js
===================================================================
--- /Users/sgonzale/Documents/workspace/jQuery UI/ui/ui.dialog.js	(revision 1184)
+++ /Users/sgonzale/Documents/workspace/jQuery UI/ui/ui.dialog.js	(working copy)
@@ -411,11 +411,12 @@
 
 		$.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({
@@ -422,16 +423,19 @@
 			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);
 	}
 });

Download in other formats:

Original Format