Scrolling Enhancements (#2417)
This commit is contained in:
parent
8875bc3585
commit
f4e8daf983
15 changed files with 51 additions and 71 deletions
|
@ -271,13 +271,20 @@ export class DownloadService {
|
|||
}
|
||||
|
||||
private save(blob: Blob, filename: string) {
|
||||
const saveLink = document.createElement( 'a' );
|
||||
if (saveLink.href) {
|
||||
URL.revokeObjectURL(saveLink.href);
|
||||
}
|
||||
saveLink.href = URL.createObjectURL(blob);
|
||||
const saveLink = document.createElement('a');
|
||||
saveLink.style.display = 'none';
|
||||
document.body.appendChild(saveLink);
|
||||
|
||||
const url = URL.createObjectURL(blob);
|
||||
saveLink.href = url;
|
||||
saveLink.download = filename;
|
||||
saveLink.dispatchEvent( new MouseEvent( 'click' ) );
|
||||
|
||||
// Trigger the click event
|
||||
saveLink.click();
|
||||
|
||||
// Cleanup
|
||||
URL.revokeObjectURL(url);
|
||||
document.body.removeChild(saveLink);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue