From 5d3cba23843f53b4a8ff12f2ebca969e211c101d Mon Sep 17 00:00:00 2001 From: TRMSC Date: Thu, 9 Nov 2023 08:02:50 +0100 Subject: [PATCH] update button value, close #14 --- docs/src/script.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/script.js b/docs/src/script.js index c603afb..3f628c4 100644 --- a/docs/src/script.js +++ b/docs/src/script.js @@ -8,11 +8,13 @@ /** * Define global variables * + * @param {boolean} hasGenerated State of the generating progress * @param {array} templatesData Empty array for the templates.json content * @param {array} templatePath Path to the template directory depending on github or server adress * @param {array} shareData Site information for share method * */ +let hasGenerated = false; let templatesData = []; let templatesPath; const shareData = { @@ -217,10 +219,17 @@ getValues = () => { */ changeStatus = () => { + // Handle status feedback let status = document.getElementById('imagescene-status'); status.textContent = '🔁 Ergebnis ist nicht aktuell'; status.setAttribute('title', 'Bitte Szene mit den geänderten Werten neu generieren'); + // Adjust button value + if (hasGenerated) { + let update = document.getElementById('imagescene-generate'); + update.value = "Szene aktualisieren"; + } + }; @@ -346,6 +355,7 @@ generateScene = () => { let status = document.getElementById('imagescene-status'); status.textContent = '✅ Ergebnis ist aktuell'; status.setAttribute('title', 'Die generierte Szene entspricht den Eingaben innerhalb des Generators'); + hasGenerated = true; // Show result let show = document.getElementById('resultpart');