Skip to content

Commit

Permalink
step progress bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Karen committed May 16, 2017
1 parent 64028cb commit ef3279a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions classes/Step.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export class Step {
this.next = params.next
this.methods = params.methods || {}
this.template = params.template || ''
this.ignore_progress = params.ignore_progress || false
this.from = null
this._data = {}
params.interceptors = params.interceptors || {}
Expand Down
10 changes: 6 additions & 4 deletions classes/StepSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class StepSystem {
return this
}
if (next_step) {
this.goToStep(this.step(next_step), curr_step.name)
this.goToStep(this.step(next_step), { from: curr_step.name })
} else {
if (this.onFinish) {
this.onFinish()
Expand All @@ -106,18 +106,20 @@ export class StepSystem {
return this
}
if (prev_step) {
this.goToStep(this.step(prev_step))
this.steps_past.pop()
this.goToStep(this.step(prev_step), { is_back: true })
}
}

goToStep (step, from = null) {
goToStep (step, params = {}) {
let from = params.from || null
let is_back = params.is_back || false
if (from) {
step.from = from
}
this._current_step = step.name
this.render(step)
if (this.steps_past.indexOf(step.name) < 0) {
if (this.steps_past.indexOf(step.name) < 0 && !is_back) {
this.steps_past.push(step.name)
}
this.updateProgress()
Expand Down
11 changes: 7 additions & 4 deletions example/dist/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef3279a

Please sign in to comment.