From 93c2dfff7194fe7e45e6bd0bf4863d8604dab0bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 26 Jun 2008 00:55:24 +0000 Subject: [PATCH] Dialog: Restructured button creation and fixed the problem with not being able to change the buttons after instantiation. --- ui/ui.dialog.js | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) 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) { - $('