From 39e530a6a2aa7068dea23b8130f52f80afe4fed1 Mon Sep 17 00:00:00 2001 From: Francisco Seipel Date: Thu, 31 Oct 2024 11:39:09 +0100 Subject: [PATCH] [TASK] Hide if nothing is to do --- Resources/Public/JavaScript/AjaxMetaGenerate.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Resources/Public/JavaScript/AjaxMetaGenerate.js b/Resources/Public/JavaScript/AjaxMetaGenerate.js index 1cb2efa..bc6399f 100644 --- a/Resources/Public/JavaScript/AjaxMetaGenerate.js +++ b/Resources/Public/JavaScript/AjaxMetaGenerate.js @@ -217,10 +217,17 @@ require([ total += credits; } } + element = document.getElementById('t3-alternative-generate-all-total-credits'); - element.innerHTML = total + ' Credits'; - element.setAttribute('data-credits', total); - element.style = ''; + if (total) { + element.innerHTML = total + ' Credits'; + element.setAttribute('data-credits', total); + element.style = ''; + } else { + element.innerHTML = 'No Credits'; + element.setAttribute('data-credits', 0); + element.style = 'display: none;'; + } } function getActiveImages(skipExistingDescriptions) {