[FIX] web: close popup after backup

All actions of the database manager redirect the user after an action except the
backup option which returns an octet stream.
Close the modal after form submission to mimic the same behaviour.

Do not close the modal for other actions than database manager to avoid waiting
time for create that may be long to process.

Add message to warn the user about backup waiting time after cliking on submit
to be less confusing for big databases that may take a lot of time to be ready.

Fixes #10803
This commit is contained in:
Martin Trigaux
2016-06-14 13:42:14 +02:00
parent e0c4ec54ca
commit 0ec664d1a7
+8
View File
@@ -27,6 +27,14 @@
$(target).find('input[name=name]').val(db);
$(target).modal();
});
// close modal on submit
$('.modal').on('click','input[type="submit"]', function(ev) {
var modal = $(this).parentsUntil('body', '.modal');
if (modal.hasClass('o_database_backup')) {
$(modal).modal('hide');
$('.list-group').before("<div class='alert alert-info'>The backup may take some time before being ready</div>");
}
});
});
</script>
</head>