* allow BACK button to work even if invalid state VRFS-3924

This commit is contained in:
Seth Call 2016-02-09 10:14:37 -06:00
parent d7ddff9bb7
commit 1da6749d70
5 changed files with 8 additions and 4 deletions

View File

@ -55,7 +55,7 @@ rest = window.JK.Rest()
handleNav: (e) ->
navTo = this.navDestination(e)
this.state.validate_basics = true
teacherActions.change.trigger(this.state, {navTo: navTo})
teacherActions.change.trigger(this.state, {navTo: navTo, instructions:e})
render: () ->
# Render the following:

View File

@ -53,7 +53,7 @@ rest = window.JK.Rest()
handleNav: (e) ->
logger.debug("handleNav #{this.screenName()}: ", this.state, this, e)
navTo = this.navDestination(e)
teacherActions.change.trigger(this.state, {navTo: navTo})
teacherActions.change.trigger(this.state, {navTo: navTo, instructions:e})
handleListChange: (listName, listObjects)->
logger.debug("EXPERIENCE handleListChange:", listName, listObjects)

View File

@ -43,7 +43,7 @@ rest = window.JK.Rest()
handleNav: (e) ->
navTo = this.navDestination(e)
teacherActions.change.trigger(this.state, {navTo: navTo})
teacherActions.change.trigger(this.state, {navTo: navTo, instructions:e})
render: () ->
`<div className="TeacherSetupIntroduction TeacherSetupComponent" >

View File

@ -150,7 +150,7 @@ rest = window.JK.Rest()
if navTo == 'rejected'
# do nothing...handled elsewhere
else
teacherActions.change.trigger(this.state, {navTo: navTo})
teacherActions.change.trigger(this.state, {navTo: navTo, instructions:e})
handleFocus: (e) ->
@pricePerLessonCents=e.target.value

View File

@ -69,6 +69,10 @@ EVENTS = context.JK.EVENTS
if (jqXHR.status==422)
logger.debug("FAILED422",jqXHR.responseJSON.errors)
this.trigger({errors: jqXHR.responseJSON.errors})
if instructions?.instructions?.direction == 'back'
if instructions.navTo?
logger.debug("NAVIGATING TO",instructions.navTo)
window.location = instructions.navTo
else
context.JK.app.ajaxError(textStatus)
)