Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow links and form submits to call PushState.replace #7

Open
jasononeil opened this issue Aug 14, 2015 · 4 comments
Open

Allow links and form submits to call PushState.replace #7

jasononeil opened this issue Aug 14, 2015 · 4 comments

Comments

@jasononeil
Copy link
Owner

... not just PushState.push

It might look like:

 <a href='/home' rel="pushstate">New history item created</a>
 <a href='/blog' rel="pushstate-replace">NO new history item created</a>
 <a href='/home' class="pushstate">New history item created</a>
 <a href='/home' class="pushstate-replace">NO new history item created</a>

It would be implemented much the same way during PushState.init()

Ping @kevinresol

@jasononeil
Copy link
Owner Author

Is pushstate-replace the best name or is there something less.... verbose?

@kevinresol
Copy link

I would recommend a data-attribute. To me class is mostly used for css styling.

data-pushstate or data-pushstate="push" => push()
data-pushstate="replace" => replace()

but that would be a breaking change

@kevinresol
Copy link

or data-ps-push data-ps-replace?

@jasononeil
Copy link
Owner Author

I like the idea of using a data attribute. We can maintain the class/rel support for backwards compatibility but suggest using data-pushstate as the main option. I think I prefer that to data-ps also. It's more verbose but more obvious what it does...

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

No branches or pull requests

2 participants