mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 15:18:58 +01:00
Make sure dialog is created before trying to update buttons
This commit is contained in:
parent
14db2bd42e
commit
2beadad730
@ -321,11 +321,7 @@ var et2_dialog = et2_widget.extend({
|
|||||||
*/
|
*/
|
||||||
set_buttons: function(buttons) {
|
set_buttons: function(buttons) {
|
||||||
this.options.buttons = buttons;
|
this.options.buttons = buttons;
|
||||||
if(typeof buttons == "number" && typeof this._buttons[buttons] != "undefined")
|
if (buttons instanceof Array)
|
||||||
{
|
|
||||||
this.div.dialog("option", "buttons", this._buttons[buttons]);
|
|
||||||
}
|
|
||||||
else if (buttons instanceof Array)
|
|
||||||
{
|
{
|
||||||
for (var i = 0; i < buttons.length; i++)
|
for (var i = 0; i < buttons.length; i++)
|
||||||
{
|
{
|
||||||
@ -335,10 +331,16 @@ var et2_dialog = et2_widget.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.options.buttons = buttons;
|
this.options.buttons = buttons;
|
||||||
this.div.dialog("option", "buttons", buttons);
|
|
||||||
}
|
}
|
||||||
// Focus default button so enter works
|
|
||||||
$j('.ui-dialog-buttonpane button[default]',this.div.parent()).focus();
|
// If dialog already created, update buttons
|
||||||
|
if(this.div.data('uiDialog'))
|
||||||
|
{
|
||||||
|
this.div.dialog("option", "buttons", buttons);
|
||||||
|
|
||||||
|
// Focus default button so enter works
|
||||||
|
$j('.ui-dialog-buttonpane button[default]',this.div.parent()).focus();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user