mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
17 lines
445 B
JavaScript
17 lines
445 B
JavaScript
|
import Service from '@ember/service';
|
||
|
|
||
|
export default class UtilsService extends Service {
|
||
|
downloadFile(url) {
|
||
|
let iframe = document.getElementById('iframeDownload');
|
||
|
|
||
|
if (!iframe) {
|
||
|
iframe = document.createElement('iframe');
|
||
|
iframe.id = 'iframeDownload';
|
||
|
iframe.style.display = 'none';
|
||
|
document.body.append(iframe);
|
||
|
}
|
||
|
|
||
|
iframe.setAttribute('src', url);
|
||
|
}
|
||
|
}
|