This commit is contained in:
Valeria Fadeeva 2023-12-15 20:47:39 +05:00
parent 70613257e2
commit 8f5cc744cc
2 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,7 @@ if(query == "/mastodon") {
value.forEach(obj1 => {
Object.entries(obj1).forEach(([k, v]) => {
if(k == "preview_url") {
media_link += `<img src="${v}" class="fullscreen" onclick="showFullscreenImage(this);">`;
media_link += `<img src="${v}" full_src="${obj1.url}" class="fullscreen" onclick="showFullscreenImage(this);">`;
}
});

View File

@ -14,7 +14,12 @@ function openInNewTab(url) {
}
function showFullscreenImage(element) {
imageSrc = element.getAttribute('src');
if (element.hasAttribute('full_src')) {
imageSrc = element.getAttribute('full_src');
} else {
imageSrc = element.getAttribute('src');
}
imageAlt = element.getAttribute('alt');
myModalImg = document.getElementById('myModalImg');