added download event listener

This commit is contained in:
rohitkumarankam 2022-02-25 23:09:40 +05:30
parent f37ebd7b39
commit 9a92be06a0

View File

@ -61,6 +61,16 @@
window.location = rawLink;
});
}
document.querySelector(".download-listener").addEventListener("click", () => {
var element = document.createElement('a');
const rawLink = RawLink.generate(rsg);
element.setAttribute('href', rawLink);
element.setAttribute('download', rsg.getSelectedCommandName() + '.txt');
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
})
const filterCommandData = function (data, { commandType, filter }) {
return data.filter(item => {