mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-04 20:42:59 +00:00
fef
This commit is contained in:
+4
-3
@@ -126,9 +126,10 @@
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const img = document.createElement('img');
|
const img = document.createElement('img');
|
||||||
// Fix image path - remove any leading slashes and add the correct base path
|
// Handle image path - use as is if it's an absolute path or URL
|
||||||
const cleanImagePath = bannerImage.replace(/^\/+/, '');
|
img.src = bannerImage.startsWith('http') || bannerImage.startsWith('/')
|
||||||
img.src = bannerImage.startsWith('http') ? bannerImage : `/uploads/${cleanImagePath}`;
|
? bannerImage
|
||||||
|
: `/uploads/${bannerImage.replace(/^\/+/, '')}`;
|
||||||
img.alt = 'Banner image';
|
img.alt = 'Banner image';
|
||||||
img.style.cssText = `
|
img.style.cssText = `
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user