diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-05-04 16:10:50 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-05-04 16:10:50 +0200 |
| commit | ac63dfc8f48fa6451b4ef94e24e784f252b84f8e (patch) | |
| tree | 768b741e1a34a94b95977d8ff869143aab73617e /addons/mail/static/src/js/composer.js | |
| parent | 62705aee69460457c1b9257ac30363754c60c973 (diff) | |
| parent | 8dade01e2c5b560864291fb3c437ccf5999aee12 (diff) | |
[MERGE] forward port branch 11.0 up to 8dade01e2c5
Diffstat (limited to 'addons/mail/static/src/js/composer.js')
| -rw-r--r-- | addons/mail/static/src/js/composer.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js index 3a7b9c320e1..8354fe610b5 100644 --- a/addons/mail/static/src/js/composer.js +++ b/addons/mail/static/src/js/composer.js @@ -565,6 +565,9 @@ var BasicComposer = Widget.extend({ on_click_add_attachment: function () { this.$('input.o_input_file').click(); this.$input.focus(); + // set ignoreEscape to avoid escape_pressed event when file selector dialog is opened + // when user press escape to cancel file selector dialog then escape_pressed event should not be trigerred + this.ignoreEscape = true; }, setState: function (state) { @@ -635,6 +638,8 @@ var BasicComposer = Widget.extend({ if (this.mention_manager.is_open()) { event.stopPropagation(); this.mention_manager.reset_suggestions(); + } else if (this.ignoreEscape) { + this.ignoreEscape = false; } else { this.trigger_up("escape_pressed"); } @@ -871,6 +876,7 @@ var BasicComposer = Widget.extend({ * @param {MouseEvent} event */ _onAttachmentView: function (event) { + event.stopPropagation(); var activeAttachmentID = $(event.currentTarget).data('id'); var attachments = this.get('attachment_ids'); if (activeAttachmentID) { |
