diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 12:09:48 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 12:09:48 +0100 |
| commit | cdb48d39ba451a7f17619072be6043da3310db2a (patch) | |
| tree | 9f741deb96e11124c25d60b837d8f37e20eb571c /addons/mail/static/src/js | |
| parent | 65de6e7f27344be275c5372a4dd76fa4396a2a9d (diff) | |
| parent | 6c55a4bfeda86b77080e9076912e0109e2cc5411 (diff) | |
[MERGE] forward port of branch 7.0 up to 6c55a4b
Diffstat (limited to 'addons/mail/static/src/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 130aaa82d7c..33172fe5933 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 () { |
