mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-18 03:38:49 +00:00
fix(mail(js)): show "Download all attachments" menu option
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<md-icon>reply</md-icon>
|
||||
</md-button>
|
||||
<md-button class="sg-icon-button"
|
||||
ng-show="viewer.message.allowReplyAll()"
|
||||
ng-show="::viewer.message.allowReplyAll()"
|
||||
ng-click="viewer.replyAll($event)"
|
||||
label:aria-label="Reply All">
|
||||
<md-tooltip md-direction="bottom"><var:string label:value="Reply to sender and all recipients"/></md-tooltip>
|
||||
@@ -92,7 +92,7 @@
|
||||
<var:string label:value="Download message (zip)"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
<md-menu-item ng-show="::viewer.message.attachmentAttrs.length">
|
||||
<md-menu-item ng-show="::viewer.message.hasAttachments()">
|
||||
<md-button label:aria-label="Download all attachments"
|
||||
ng-click="viewer.message.downloadAttachmentsArchive()">
|
||||
<var:string label:value="Download all attachments"/>
|
||||
|
||||
@@ -556,6 +556,22 @@
|
||||
return Message.$$resource.post(this.$absolutePath(), 'sendMDN');
|
||||
};
|
||||
|
||||
/**
|
||||
* @function hasAttachments
|
||||
* @memberof Message.prototype
|
||||
* @returns true if there's one ore more attached files
|
||||
*/
|
||||
Message.prototype.hasAttachments = function(content) {
|
||||
var _this = this;
|
||||
|
||||
return !!_.find(content || this.parts.content, function(part) {
|
||||
if (angular.isArray(part.content)) {
|
||||
return _this.hasAttachments(part.content);
|
||||
}
|
||||
return part.type == 'UIxMailPartLinkViewer' || part.type == 'UIxMailPartImageViewer';
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $deleteAttachment
|
||||
* @memberof Message.prototype
|
||||
|
||||
Reference in New Issue
Block a user