Skip to content
Snippets Groups Projects
Commit 84b5bf94 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[IMP] mail: prevent leaving when composing a message

parent 67959566
No related branches found
No related tags found
No related merge requests found
......@@ -408,6 +408,16 @@ openerp.mail = function (session) {
this.is_log = false;
this.recipients = [];
this.recipient_ids = [];
session.web.bus.on('clear_uncommitted_changes', this, function(e) {
if (this.show_composer && !e.isDefaultPrevented()){
if (!confirm(_t("You are currently composing a message, your message will be discarded.\n\nAre you sure you want to leave this page ?"))) {
e.preventDefault();
}
else{
this.on_cancel();
}
}
});
},
start: function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment