Skip to content

Commit

Permalink
update button value, close #14
Browse files Browse the repository at this point in the history
  • Loading branch information
TRMSC committed Nov 9, 2023
1 parent 58a9378 commit 5d3cba2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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";
}

};


Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 5d3cba2

Please sign in to comment.