Skip to content

Commit

Permalink
fix: insert multiple assets at once via media library, closes #180
Browse files Browse the repository at this point in the history
  • Loading branch information
nshenderov committed Nov 13, 2024
1 parent 4f1f491 commit 3b6c5cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions admin/src/components/Input/components/MediaLib.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,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 3b6c5cc

Please sign in to comment.