Fix context in close function of simple dialogs

pull/5838/head
Aleksander Machniak 8 years ago
parent 38067f61da
commit 29668f4c97

@ -7653,7 +7653,7 @@ function rcube_webmail()
this.simple_dialog = function(content, title, action_func, options) this.simple_dialog = function(content, title, action_func, options)
{ {
var title = this.get_label(title), var title = this.get_label(title),
close_func = function() { (ref.is_framed() ? parent.$ : $)(this).dialog('close'); }, close_func = function(dialog) { (ref.is_framed() ? parent.$ : $)(dialog).dialog('close'); },
buttons = [{ buttons = [{
text: ref.get_label((options || {}).cancel_button || 'cancel'), text: ref.get_label((options || {}).cancel_button || 'cancel'),
click: close_func click: close_func
@ -7665,7 +7665,7 @@ function rcube_webmail()
buttons.unshift({ buttons.unshift({
text: this.get_label((options || {}).button || 'save'), text: this.get_label((options || {}).button || 'save'),
'class': 'mainaction', 'class': 'mainaction',
click: function(e) { if (action_func(e)) close_func(); } click: function(e) { if (action_func(e)) close_func(this); }
}); });
return this.show_popup_dialog(content, title, buttons, options); return this.show_popup_dialog(content, title, buttons, options);

Loading…
Cancel
Save