mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
🐛 Fixed crash when newly created images are dragged into a gallery
closes https://github.com/TryGhost/Team/issues/1020 - image card payloads should have a valid `src` attribute, use that instead of relying on the associated `img` element which won't be found/have an unexpected `src` when it's newly created because the image card will still be using the blob url generated for a preview whilst uploading
This commit is contained in:
parent
a0da052471
commit
a5fc45d169
@ -457,7 +457,7 @@ export default Component.extend({
|
||||
payload.width = payload.width || img.naturalWidth;
|
||||
payload.height = payload.height || img.naturalHeight;
|
||||
if (!payload.fileName) {
|
||||
let url = new URL(img.src);
|
||||
let url = new URL(payload.src || img.src);
|
||||
let fileName = url.pathname.match(/\/([^/]*)$/)[1];
|
||||
payload.fileName = fileName;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user