--- js/parent_old.js	2010-01-19 16:02:31.000000000 +0100
+++ js/parent.js	2010-01-19 16:12:27.032153367 +0100
@@ -654,13 +654,18 @@ Drupal.modalFrame.resize = function() {
 
   // Compute frame and dialog size based on document size.
   var maxSize = self.sanitizeSize({}), titleBarHeight = $('.modalframe .ui-dialog-titlebar').outerHeight(true);
+  // if we have a button pane
+  buttonBarHeight = 0;
+  if(self.options.customDialogOptions.buttons != undefined) {
+    buttonBarHeight = $('.modalframe .ui-dialog-buttonpane').outerHeight(true);;
+  }
   var frameSize = self.sanitizeSize(documentSize), dialogSize = $.extend({}, frameSize);
-  if ((dialogSize.height + titleBarHeight) <= maxSize.height) {
-    dialogSize.height += titleBarHeight;
+  if ((dialogSize.height + titleBarHeight + buttonBarHeight) <= maxSize.height) {
+    dialogSize.height += titleBarHeight + buttonBarHeight;
   }
   else {
     dialogSize.height = maxSize.height;
-    frameSize.height = dialogSize.height - titleBarHeight;
+    frameSize.height = dialogSize.height - titleBarHeight - buttonBarHeight;
   }
 
   // Compute dialog position centered on viewport.
