Fix files being downloaded with wrong info when link changed (e.g. menu item reused). #906
This commit is contained in:
parent
d44b206e44
commit
0ed0aed6a2
@ -82,11 +82,17 @@ ImageCommon =
|
|||||||
download: (e) ->
|
download: (e) ->
|
||||||
return true if @protocol is 'blob:'
|
return true if @protocol is 'blob:'
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
CrossOrigin.file @href, (blob) =>
|
{href, download} = @
|
||||||
|
CrossOrigin.file href, (blob) ->
|
||||||
if blob
|
if blob
|
||||||
@href = URL.createObjectURL blob
|
a = $.el 'a',
|
||||||
@click()
|
href: URL.createObjectURL(blob)
|
||||||
|
download: download
|
||||||
|
hidden: true
|
||||||
|
$.add d.body, a
|
||||||
|
a.click()
|
||||||
|
$.rm a
|
||||||
else
|
else
|
||||||
new Notice 'warning', "Could not download #{@href}", 20
|
new Notice 'warning', "Could not download #{href}", 20
|
||||||
|
|
||||||
return ImageCommon
|
return ImageCommon
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user