I’ve been searching high and low for a solution to this problem and can only find solution that do half the job.
Say I have a
photo model and I want to be able to open a viewer modal for them.
/photos route I have an infinite scrolling grid of photos, and clicking on one opens the viewer modal. The URL should then update to
/photos/:id (or could be something like
/p/:id if necessary). When the modal is closed, the user should go back to the infinite scrolling grid without having lost their place.
However, photos are linked from other pages as well. So for instance, you could be on a
/test page that contains a photo, and open it in the modal. The URL would update to the photo’s unique URL, but closing the modal would take you back to
I see this behaviour a lot on sites like Facebook, Twitter, Pinterest, Dribbble etc, but I can’t figure out how to implement it in the Ember Way. I could try overriding the router URL manually on modal open/close, but I’m not sure if that’s safe. Alternatively sub-routes don’t seem like they’d work here, because modals can be opened from many different routes but maintain the top-level
If anyone has any ideas would love the help!