fix: removed duplicate companies

This commit is contained in:
Michael Green
2023-06-30 23:17:03 +10:00
parent 0cc8e76f77
commit 0e3a3b3ecd
2 changed files with 22 additions and 12 deletions

View File

@@ -128,12 +128,16 @@
var gamePublisherLoaded = false;
if (result.involvedCompanies) {
ajaxCall('/api/v1/games/' + gameId + '/companies', 'GET', function (result) {
var lstDevelopers = [];
var lstPublishers = [];
for (var i = 0; i < result.length; i++) {
var companyLabel = document.createElement('span');
companyLabel.className = 'gamegenrelabel';
companyLabel.innerHTML = result[i].company.name;
if (result[i].involvement.developer == true) {
if (!lstDevelopers.includes(result[i].company.name)) {
if (gameHeaderDeveloperLabel.innerHTML.length > 0) {
gameHeaderDeveloperLabel += ", ";
}
@@ -141,14 +145,20 @@
gameDeveloperLabel.appendChild(companyLabel);
lstDevelopers.push(result[i].company.name);
gameDeveloperLoaded = true;
}
} else {
if (result[i].involvement.publisher == true) {
if (!lstPublishers.includes(result[i].company.name)) {
lstPublishers.push(result[i].company.name);
gamePublisherLabel.appendChild(companyLabel);
gamePublisherLoaded = true;
}
}
}
}
if (gameDeveloperLoaded == false) {
gameHeaderDeveloperLabel.setAttribute('style', 'display: none;');
@@ -346,7 +356,7 @@
for (var i = 0; i < gameScreenshots_Items.length; i++) {
if (gameScreenshots_Items[i].id == gameScreenshots_Selected.id) {
gameScreenshots_Items[i].classList.add('gamescreenshosts_gallery_item_selected');
gameScreenshots_Selected.scrollIntoView();
gameScreenshots_Selected.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
} else {
gameScreenshots_Items[i].classList.remove('gamescreenshosts_gallery_item_selected');
}

View File

@@ -16,7 +16,7 @@
h3 {
border-bottom-style: solid;
/*border-bottom-color: #916b01;*/
border-bottom-width: 3px;
border-bottom-width: 1px;
/*border-image: linear-gradient(to right, blue 25%, yellow 25%, yellow 50%,red 50%, red 75%, teal 75%) 5;*/
border-image: linear-gradient(to right, rgba(255,0,0,1) 0%, rgba(251,255,0,1) 16%, rgba(0,255,250,1) 30%, rgba(0,16,255,1) 46%, rgba(250,0,255,1) 62%, rgba(255,0,0,1) 78%, rgba(255,237,0,1) 90%, rgba(20,255,0,1) 100%) 5;
@@ -388,7 +388,7 @@ iframe {
}
.gamescreenshosts_gallery_item:hover {
border-color: lightblue;
border-color: lightgray;
}
.gamescreenshosts_gallery_item_selected {