From: Scott González Date: Thu, 26 Jun 2008 00:55:24 +0000 (+0000) Subject: Dialog: Restructured button creation and fixed the problem with not being able to... X-Git-Tag: 1.5.1~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=93c2dfff7194fe7e45e6bd0bf4863d8604dab0bb;p=jquery-ui.git Dialog: Restructured button creation and fixed the problem with not being able to change the buttons after instantiation. --- diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index d6a7fb220..120a855e3 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -77,7 +77,11 @@ $.widget("ui.dialog", { }) .mousedown(function() { self.moveToTop(); - }); + }), + + uiDialogButtonPane = (this.uiDialogButtonPane = $('
')) + .addClass('ui-dialog-buttonpane') + .appendTo(uiDialog); this.uiDialogTitlebarClose = $('.ui-dialog-titlebar-close', uiDialogTitlebar) .hover( @@ -96,19 +100,6 @@ $.widget("ui.dialog", { return false; }); - var hasButtons = false; - $.each(options.buttons, function() { return !(hasButtons = true); }); - if (hasButtons) { - var uiDialogButtonPane = $('
') - .appendTo(uiDialog); - $.each(options.buttons, function(name, fn) { - $('