fixed link generation
This commit is contained in:
parent
fe30758a93
commit
1cd4196765
|
@ -306,10 +306,10 @@ class CCPMethodEditorController extends HTMLElement{
|
||||||
}
|
}
|
||||||
).then(data=>{
|
).then(data=>{
|
||||||
const filename = data.title + "-" + data.version + ".json"
|
const filename = data.title + "-" + data.version + ".json"
|
||||||
const objectURL = URL.createObjectURL(data)
|
const datastr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(data));
|
||||||
var tmplnk = document.createElement("a")
|
var tmplnk = document.createElement("a")
|
||||||
tmplnk.download = filename
|
tmplnk.download = filename
|
||||||
tmplnk.href = objectURL
|
tmplnk.href = datastr
|
||||||
document.body.appendChild(tmplnk)
|
document.body.appendChild(tmplnk)
|
||||||
tmplnk.click()
|
tmplnk.click()
|
||||||
document.body.removeChild(tmplnk)
|
document.body.removeChild(tmplnk)
|
||||||
|
|
Loading…
Reference in New Issue