Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Browser history #17

Open
nafg opened this issue Jul 8, 2011 · 5 comments
Open

Browser history #17

nafg opened this issue Jul 8, 2011 · 5 comments

Comments

@nafg
Copy link
Owner

nafg commented Jul 8, 2011

No description provided.

@fmpwizard
Copy link

This would be awesome! Do you have any plans on how to implement it? After I did my prototype for lift I found out there is also a HTML5 history api on most current browsers

@nafg
Copy link
Owner Author

nafg commented Aug 12, 2011

On Thu, Aug 11, 2011 at 9:14 PM, fmpwizard <
reply@reply.github.com>wrote:

This would be awesome!

Who do you think gave me the idea? ;)

Do you have any plans on how to implement it?

Not too specific.

After I did my prototype for lift I found out there is also a HTML5 history
api on most current browsers

Reply to this email directly or view it on GitHub:
#17 (comment)

@fmpwizard
Copy link

I hope to have some time in the coming weeks to look over at the demo I did using Lift and I'll try to reduce the manual JavaScript I wrote and see what comes out.

@nafg
Copy link
Owner Author

nafg commented Apr 24, 2015

I finally had a need to do some history integration. It's actually not too bad, especially with the (recently merged) JsInterpolator:

    for(state <- signal.change) {
      val newUrl = constructUrl(state)
      page.queue(js"""history.pushState($state, "", $newUrl)""")
    }
    def popState(state: State) = signal ()= state
    page.queue(js"""window.onpopstate = function(event) { ${popState _}(event.state)""")

@fmpwizard better late than never :)

I think this sort of obviates the need for a built-in feature, but I'm open to input.

@nafg
Copy link
Owner Author

nafg commented Apr 24, 2015

(I'm using reactive-routing for associating a "State" with a reversible route, as well)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants