Skip to content

Instantly share code, notes, and snippets.

@pier-oliviert
Created November 30, 2012 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pier-oliviert/ccfcb8862620eece405c to your computer and use it in GitHub Desktop.
Save pier-oliviert/ccfcb8862620eece405c to your computer and use it in GitHub Desktop.
modal = $("#log-form-modal")
contact = modal.find("#contact-form-modal")
if contact.length > 0
navigationWrapper = modal.find("#modal-navigation-wrapper")
contact = $("<%= j render("form", :contact => @contact, :back_button => true) %>")
contact.previousNavigationViews = navigationWrapper.children().detach();
contact.popNavigationStack = ->
navigationWrapper.html(contact.previousNavigationViews)
contact.on "click", "#ui-dialog-back-btn", ->
contact.popNavigationStack()
navigationWrapper.html(contact)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment