From 0ec664d1a7c532965d435d49ec9c1b09cab4b5dc Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 14 Jun 2016 10:31:02 +0200 Subject: [PATCH] [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 --- addons/web/views/database_manager.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/views/database_manager.html b/addons/web/views/database_manager.html index 1dc5030c6c9..ad7076313ae 100644 --- a/addons/web/views/database_manager.html +++ b/addons/web/views/database_manager.html @@ -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("
The backup may take some time before being ready
"); + } + }); });