Skip to content

Commit

Permalink
fix: insert multiple assets at once via media library #180
Browse files Browse the repository at this point in the history
  • Loading branch information
nshenderov committed Nov 13, 2024
1 parent 230b634 commit 18a00d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions admin/src/Input/components/MediaLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ export const MediaLib = ({ isOpen = false, onToggle = () => {}, editor }) => {
let set = '';
let keys = Object.keys(formats).sort((a, b) => formats[a].width - formats[b].width);
keys.map((k) => (set += prefixFileUrlWithBackendUrl(formats[k].url) +` ${formats[k].width}w,`));
newValue = `<img src="${url}" alt="${alt}" width="${width}" height="${height}" srcset="${set}" />`;
newValue += `<img src="${url}" alt="${alt}" width="${width}" height="${height}" srcset="${set}" />`;
} else {
newValue = `<img src="${url}" alt="${alt}" width="${width}" height="${height}" />`;
newValue += `<img src="${url}" alt="${alt}" width="${width}" height="${height}" />`;
}
} else if (mime.includes('video')) {
newValue = `
newValue += `
<video class="video" controls width="500px">
<source src="${url}" type="${mime}" />
</video>`;
} else {
newValue = `<a href="${url}">${name || 'Open document'}</a>`;
newValue += `<a href="${url}">${name || 'Open document'}</a>`;
}
});

Expand Down

0 comments on commit 18a00d2

Please sign in to comment.