js: pass response as gadjo:dialog-done event parameter (#8995)

This commit is contained in:
Frédéric Péters 2015-11-16 14:36:06 +01:00
parent 39682b3dc4
commit 3fbcdbc636
1 changed files with 4 additions and 4 deletions

View File

@ -58,9 +58,9 @@
if ('location' in data) {
var e = $.Event('gadjo:dialog-done');
if (document.contains($anchor[0])) {
$anchor.trigger(e, form);
$anchor.trigger(e, data);
} else {
$(document).trigger(e, form);
$(document).trigger(e, data);
}
/* check if the event action has been prevented, and don't do
* anything in that case. */
@ -144,8 +144,8 @@
type: 'POST',
url: action_url,
data: $form.serialize(),
}).success(function() {
$anchor.trigger('gadjo:dialog-done');
}).success(function(data) {
$anchor.trigger('gadjo:dialog-done', data);
$form.dialog('destroy');
}).fail(function() { $anchor.trigger('gadjo:dialog-submit-error');
});