Skip to main content

Search and Top Navigation

#4846 closed bug (fixed)

Opened September 09, 2009 09:11PM UTC

Closed July 10, 2010 10:43PM UTC

Last modified August 04, 2010 01:21AM UTC

Setting Dialog height shorter after init hides button pane

Reported by: redjag Owned by:
Priority: major Milestone: 1.8.3
Component: ui.dialog Version: 1.7.2
Keywords: dialog height button Cc:
Blocked by: Blocking:
Description

I am creating a dialog window with a couple buttons in the button pane at init time. Reducing the height after init using jQuery('#dialogWindow').dialog('option','height',200) shortens the window without shortening the container, leaving the button pane outside the dialog window and inaccessible. After doing this manual resize, trying to use the mouse to make the window taller fails to bring the button pane back in to view as the resize code seems to maintain the distance created by manually resizing. If I manually increase the height by the amount it was reduced, the button pane comes back in to view.

Attachments (0)
Change History (7)

Changed October 14, 2009 10:31PM UTC by nminale comment:1

I also have the same problem.

When I change width and/or height of the dialog after it's created by calling

$('#dialogWindow').dialog('option','height',200);

$('#dialogWindow').dialog('option','width',200);

The size of the dialog is changed, but the content's and button pane's are not. So, you will see no button pane at all if the new height is smaller or you will see it stuck in the middle if the new height is bigger.

So my fix for now is that I modified the _setData function -- case "width" and "height" to recalculate the size of all components inside the dialog.

...

case "width":

this.uiDialog.width(value);

this.options.width = value;

this._size();

break;

case "height":

this.uiDialog.height(value);

this.options.height = value;

this._size();

break;

...

Just in case this helps someone else with the same problem while waiting for the official fix :)

Changed October 14, 2009 10:35PM UTC by nminale comment:2

Uh. Forgot to set formatting. Here is the code again.

... 
case "width":

    this.uiDialog.width(value); 
    this.options.width = value; 
    this._size(); break;
case "height":
    this.uiDialog.height(value); 
    this.options.height = value; 
    this._size(); break;

...

Thanks.

Changed November 16, 2009 09:19PM UTC by jzaefferer comment:3

milestone: TBD1.8

Changed November 18, 2009 03:11PM UTC by dcramer comment:4

In addition to this. If you create a dialog without buttons, then add a button by calling

$("#dialogWindow").dialog('option', 'buttons', {
  'Close': function() {
    $(this).dialog("close");
  }
});

You can drag resize past the buttons pane and acts as if the buttons pane is part of the content.

Changed July 10, 2010 03:48PM UTC by bostanio comment:5

Turns out this bug is fixed in 1.9. However, there is one remaining issue that the height is not calculated correctly if buttons are added or removed. Fix for that submitted to be pulled from this commit

http://github.com/bostanio/jquery-ui/commit/7dbff1bfbfe34234f33b71b3b107551a3cebe242

Changed July 10, 2010 10:43PM UTC by scottgonzalez comment:6

resolution: → fixed
status: newclosed

Fixed in f560862. Thanks bostanio.

Changed August 04, 2010 01:21AM UTC by scottgonzalez comment:7

milestone: 1.91.8.3