diff options
| author | Thanh Dodeur <tso@odoo.com> | 2018-12-21 08:29:59 +0000 |
|---|---|---|
| committer | Thanh Dodeur <tso@odoo.com> | 2019-01-28 11:24:48 +0000 |
| commit | 3c9cf1e75302a3bece19848cc3393f91564549fa (patch) | |
| tree | df1df307fb705d7b72428e0e988433d2e9857a88 /addons/mail/static/src/js/thread_widget.js | |
| parent | e27f0ee7efa1419f2388e58c2531be94c7214638 (diff) | |
[IMP] mail: adds delete and upload to chatter
backport of 73d9b9588f24788766c66aacd69ed436bb0223f4
This commit adds the ability to upload and delete
attachments from the chatter.
closes odoo/odoo#30636
Diffstat (limited to 'addons/mail/static/src/js/thread_widget.js')
| -rw-r--r-- | addons/mail/static/src/js/thread_widget.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/thread_widget.js b/addons/mail/static/src/js/thread_widget.js index e6da87c6dba..01af2e73d7c 100644 --- a/addons/mail/static/src/js/thread_widget.js +++ b/addons/mail/static/src/js/thread_widget.js @@ -34,6 +34,7 @@ var ThreadWidget = Widget.extend({ 'click .o_thread_show_more': '_onClickShowMore', 'click .o_attachment_download': '_onAttachmentDownload', 'click .o_attachment_view': '_onAttachmentView', + 'click .o_attachment_delete_cross': '_onDeleteAttachment', 'click .o_thread_message_needaction': '_onClickMessageNeedaction', 'click .o_thread_message_star': '_onClickMessageStar', 'click .o_thread_message_reply': '_onClickMessageReply', @@ -420,6 +421,18 @@ var ThreadWidget = Widget.extend({ }); }, /** + * @private + * @param {MouseEvent} ev + */ + _onDeleteAttachment: function (ev) { + ev.stopPropagation(); + var $target = $(ev.currentTarget); + this.trigger_up('delete_attachment', { + attachmentId: $target.data('id'), + attachmentName: $target.data('name') + }); + }, + /** * @private * @param {Object} options * @param {integer} [options.channelID] |
