Conditionally add btn_refresh event based on READ_AND_CONFIRM

Only attach click handlers to btn_refresh elements when
READ_AND_CONFIRM is false. btn_complete and btn_reject
handlers remain unaffected. This change applies to both
app.js and app.min.js.
This commit is contained in:
2026-01-20 11:11:59 +01:00
parent 75097afa06
commit 383634fca6
2 changed files with 4 additions and 2 deletions

View File

@@ -44,7 +44,9 @@ class App {
}
//add click events of external buttons
[...document.getElementsByClassName('btn_refresh')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('RESET')));
if (!READ_AND_CONFIRM) {
[...document.getElementsByClassName('btn_refresh')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('RESET')));
}
[...document.getElementsByClassName('btn_complete')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('FINISH')));
[...document.getElementsByClassName('btn_reject')].forEach(btn => btn.addEventListener('click', _ => this.handleClick('REJECT')));
}