Asked By: Anonymous
I have a list of items in
#/xxx which when clicked will pop up a lightbox and change the hash to
#/xxx/yyy. In the lightbox, there’s a “Back” button. How do I revert to previous page (i.e. “
#/xxx“)? I’m looking for something like “
Backbone.back()“. This action must not trigger the route handler (otherwise the list of items will be empty since it’s an Ajax search result).
Answered By: Anonymous
There’s two easy ways I can think of doing this:
1) Make the “back” button not really go back at all, just repeat the previous route (the one prior to bringing up the lightbox) again. Then going backwards and forwards through the history will produce the results you expect to see.
Results should be just like the other way of doing the same thing.