Permalink
Browse files

Dialog: Wrap buttons in a div so we can float the div instead of the …

…individual buttons. Fixes #4529 - dialog buttons are accessed in wrong order using tab.
  • Loading branch information...
1 parent f00c031 commit 61e0aeac7e626df711e7066f27b652602387b784 @scottgonzalez scottgonzalez committed Jul 30, 2010
Showing with 8 additions and 4 deletions.
  1. +1 −1 tests/unit/dialog/dialog_options.js
  2. +2 −1 themes/base/jquery.ui.dialog.css
  3. +5 −2 ui/jquery.ui.dialog.js
@@ -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 = {
@@ -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; }
@@ -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();
@@ -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();
}

0 comments on commit 61e0aea

Please sign in to comment.