mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
#89 added downloading of decrypted attachments
This commit is contained in:
parent
4a1c3beb78
commit
25a786d584
5 changed files with 36 additions and 30 deletions
|
|
@ -1,11 +1,12 @@
|
|||
import { ComposeType/*, FolderType*/ } from 'Common/EnumsUser';
|
||||
import { EmailModel } from 'Model/Email';
|
||||
import { isArray } from 'Common/Utils';
|
||||
import { createElement } from 'Common/Globals';
|
||||
import { doc, createElement } from 'Common/Globals';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
import * as Local from 'Storage/Client';
|
||||
import { plainToHtml } from 'Common/Html';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
export const
|
||||
|
||||
|
|
@ -20,6 +21,24 @@ sortFolders = folders => {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} link
|
||||
* @returns {boolean}
|
||||
*/
|
||||
download = (link, name = "") => {
|
||||
if (ThemeStore.isMobile()) {
|
||||
open(link, '_self');
|
||||
focus();
|
||||
} else {
|
||||
const oLink = createElement('a');
|
||||
oLink.href = link;
|
||||
oLink.target = '_blank';
|
||||
oLink.download = name;
|
||||
doc.body.appendChild(oLink).click();
|
||||
oLink.remove();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Array=} aDisabled
|
||||
* @param {Array=} aHeaderLines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue