#12260 Adjusted icon path depending on icon extension

This commit is contained in:
Jorge Rincon 2023-10-23 11:14:30 +02:00
parent 48c314669a
commit 0e58c64a39
2 changed files with 8 additions and 1 deletions

View File

@ -84,6 +84,9 @@ if (is_ajax() === true) {
}
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
if (str_contains($group['icon'], '.png') === true) {
$group['folder'] = 'groups_small/';
}
echo json_encode($group);
return;

View File

@ -331,9 +331,13 @@
id_group: id_group
},
function(data) {
let routeImg =
typeof data.folder === "undefined"
? "images/"
: "images/" + data.folder;
$("img", config.spanPreview).attr(
"src",
"images/" + data["icon"]
routeImg + data["icon"]
);
$("a", config.spanPreview).attr("href", hrefNew);
},