[IMP] mail: prevent leaving when composing a message
This commit is contained in:
parent
67959566ed
commit
84b5bf94bd
|
@ -408,6 +408,16 @@ openerp.mail = function (session) {
|
||||||
this.is_log = false;
|
this.is_log = false;
|
||||||
this.recipients = [];
|
this.recipients = [];
|
||||||
this.recipient_ids = [];
|
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 () {
|
start: function () {
|
||||||
|
|
Loading…
Reference in New Issue