mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Some array.slice to array.startsWith and cleanup some JavaScript code
This commit is contained in:
parent
3903a37b64
commit
ffcc86805a
8 changed files with 83 additions and 146 deletions
|
|
@ -177,7 +177,7 @@ export class AttachmentModel extends AbstractModel {
|
|||
const localEvent = event.originalEvent || event;
|
||||
if (attachment && localEvent && localEvent.dataTransfer && localEvent.dataTransfer.setData) {
|
||||
let link = this.linkDownload();
|
||||
if ('http' !== link.slice(0, 4)) {
|
||||
if (!link.startsWith('http')) {
|
||||
link = location.protocol + '//' + location.host + location.pathname + link;
|
||||
}
|
||||
localEvent.dataTransfer.setData('DownloadURL', this.mimeType + ':' + this.fileName + ':' + link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue