Skip to content

Commit

Permalink
Dialog: Wrap buttons in a div so we can float the div instead of the …
Browse files Browse the repository at this point in the history
…individual buttons. Fixes #4529 - dialog buttons are accessed in wrong order using tab.
  • Loading branch information
scottgonzalez committed Jul 30, 2010
1 parent f00c031 commit 61e0aea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/unit/dialog/dialog_options.js
Expand Up @@ -43,7 +43,7 @@ test("buttons", function() {
i++;
});

ok(btn.parent().hasClass('ui-dialog-buttonpane'), "buttons in container");
ok(btn.parent().hasClass('ui-dialog-buttonset'), "buttons in container");
btn.trigger("click");

var newButtons = {
Expand Down
3 changes: 2 additions & 1 deletion themes/base/jquery.ui.dialog.css
Expand Up @@ -15,6 +15,7 @@
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
7 changes: 5 additions & 2 deletions ui/jquery.ui.dialog.js
Expand Up @@ -342,7 +342,10 @@ $.widget("ui.dialog", {
'ui-dialog-buttonpane ' +
'ui-widget-content ' +
'ui-helper-clearfix'
);
),
uiButtonSet = $( "<div></div>" )
.addClass( "ui-dialog-buttonset" )
.appendTo( uiDialogButtonPane );

// if we already have a button pane, remove it
self.uiDialog.find('.ui-dialog-buttonpane').remove();
Expand All @@ -357,7 +360,7 @@ $.widget("ui.dialog", {
var button = $('<button type="button"></button>')
.text(name)
.click(function() { fn.apply(self.element[0], arguments); })
.appendTo(uiDialogButtonPane);
.appendTo(uiButtonSet);
if ($.fn.button) {
button.button();
}
Expand Down

0 comments on commit 61e0aea

Please sign in to comment.