diff options
author | Justin Choquette <jchoquette@iol.unh.edu> | 2023-08-18 15:50:38 -0400 |
---|---|---|
committer | Justin Choquette <jchoquette@iol.unh.edu> | 2023-08-21 14:35:34 -0400 |
commit | 4ecf03b0a8517a8323dd888fc74e371aab41ba67 (patch) | |
tree | bd39333365e064baa0dfca71a5172b88a8b4a414 /src/static/js/workflows/workflow.js | |
parent | ecadb07367d31c0929212618e120130f54af78da (diff) |
minor status changes
Change-Id: Ia29c2879ddea67bdb6b30c4e871d8cb97be38d41
Signed-off-by: Justin Choquette <jchoquette@iol.unh.edu>
Diffstat (limited to 'src/static/js/workflows/workflow.js')
-rw-r--r-- | src/static/js/workflows/workflow.js | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/static/js/workflows/workflow.js b/src/static/js/workflows/workflow.js index 97bf8f4..97892a2 100644 --- a/src/static/js/workflows/workflow.js +++ b/src/static/js/workflows/workflow.js @@ -196,45 +196,28 @@ class Workflow { * Enables the next button if the step is less than sections.length after executing */ goPrev() { - - if (workflow.step <= 0) { - return; - } - - this.step--; - - document.getElementById(this.sections[this.step]).scrollIntoView({behavior: 'smooth'}); - - if (this.step == 0) { - document.getElementById('prev').setAttribute('disabled', ''); - } else if (this.step == this.sections.length - 2) { - document.getElementById('next').removeAttribute('disabled'); - } + this.goTo(this.step -1); } goNext() { - if (this.step >= this.sections.length - 1 ) { - return; - } - - this.step++; - document.getElementById(this.sections[this.step]).scrollIntoView({behavior: 'smooth'}); - - if (this.step == this.sections.length - 1) { - document.getElementById('next').setAttribute('disabled', ''); - } else if (this.step == 1) { - document.getElementById('prev').removeAttribute('disabled'); - } + this.goTo(this.step + 1); } goTo(step_number) { if (step_number < 0) return; this.step = step_number + document.getElementById('workflow-next').removeAttribute('hidden'); + document.getElementById('workflow-prev').removeAttribute('hidden'); + document.getElementById(this.sections[this.step]).scrollIntoView({behavior: 'smooth'}); + + if (this.step == 0) { + document.getElementById('workflow-prev').setAttribute('hidden', ''); + + } + if (this.step == this.sections.length - 1) { - document.getElementById('next').setAttribute('disabled', ''); - } else if (this.step == 1) { - document.getElementById('prev').removeAttribute('disabled'); + document.getElementById('workflow-next').setAttribute('hidden', ''); } } |