diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
| commit | 18e22be138f4d273ce8f63c0ff2c8a437cf6ce5d (patch) | |
| tree | 63bd658de7b6fa0e91d521ca19322dd68bdc1492 /addons/mail/static/src/js/mail.js | |
| parent | f6e5bf847b1a7107c09b009a757823b0f9514fa4 (diff) | |
| parent | 0aab81cd3ac6881b2b64ccedb901b55badd421d4 (diff) | |
[MERGE] forward port of branch 8.0 up to 0aab81c
Diffstat (limited to 'addons/mail/static/src/js/mail.js')
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 59c1eaecd89..d54ad6176b1 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -369,6 +369,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 () { |
