-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
What would be the best way to implement Pinterest's overlay mechanism.
If you go to Pinterest and you click on one of the items, it brings up an overlay of the item. It also does a couple other things:
- the URL changes to the unique identifier to that item. (thus allowing the ability to share and save the url)
- When you hit the back button or close button, it transitions back to the original home state.
- Now if you go and just copy that URL straight into the browser and reload. It loads into a unique state that only contains that item, and it is no longer an overlay of the "homepage state".
Obviously I cannot just match the unique item URL, because that would prevent the unique item page from being loaded, only the overlay.
My ideas are currently use ui-bootstrap's dialog service along with 3 states. Home state, item child state of the home that doesn't have a URL parameter. And an item state. The item state would match the URL, so when a user accesses the URL directly it will navigate to the item's page. But whenever I want to bring up the overlay, I'll manually use transitionTo() to get the item child state. I haven't tried just yet, but I feel this may have problems regarding the back button.