mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 06:52:40 +00:00
(feat) improved the attachments handling code for the message editor
This commit is contained in:
1 parent
290264262c
commit
23d7c06829
5 files changed
+70
-28
No files matched your search
@@ -310,6 +310,25 @@
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $deleteAttachment
|
||||
* @memberof Message.prototype
|
||||
* @desc Delete an attachment from a message being composed
|
||||
* @param {string} filename - the filename of the attachment to delete
|
||||
*/
|
||||
Message.prototype.$deleteAttachment = function(filename) {
|
||||
var action = 'deleteAttachment?filename=' + filename;
|
||||
var _this = this;
|
||||
Message.$$resource.post(this.$absolutePath({asDraft: true}), action).then(function(data) {
|
||||
Message.$timeout(function() {
|
||||
_this.editable.attachmentAttrs = _.filter(_this.editable.attachmentAttrs, function(attachment) {
|
||||
return attachment.filename != filename});
|
||||
}, function() {
|
||||
// TODO: show toast
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @function $markAsFlaggedOrUnflagged
|
||||
* @memberof Message.prototype
|
||||
|
||||
Reference in new issue
Block a user