fbcb740dc9
## Issue 6236 Add context menu to file page ## Notes The download button actually handles a lot of things -- generating 'streamingUrl', differences between Web and Desktop, download progress for Desktop, etc. A simpler fix would be to put something else (maybe "Share") into the overflow menu instead. Anyway, went ahead to do it per 6236, but retained the item for Desktop since we need a progress label.
13 lines
412 B
JavaScript
13 lines
412 B
JavaScript
export function webDownloadClaim(streamingUrl, fileName) {
|
|
// @if TARGET='web'
|
|
let element = document.createElement('a');
|
|
element.setAttribute('href', `${streamingUrl}?download=true`);
|
|
element.setAttribute('download', fileName);
|
|
element.style.display = 'none';
|
|
// $FlowFixMe
|
|
document.body.appendChild(element);
|
|
element.click();
|
|
// $FlowFixMe
|
|
document.body.removeChild(element);
|
|
// @endif
|
|
}
|