You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.
Wiselinks has been pretty much perfect for my application, but I have a situation where I'd like to push information into the History stack without causing a reload (namely, 'pagination' via infinite scroll)
What I want to do is:
User goes to
http://example.org/home
and then scrolls down a ways, and a second page of content is loaded. I want the url in the title bar and the History stack to reflect this:
http://example.org/home?page=2
What currently happens, though, is that when I attempt to change history:
History.pushState({page: 2},'page the 2nd!','http://example.org/home?page=2');
wiselinks kicks in and replaces my existing content with the content of page 2.
I'm thinking that I just need to provide a way to disable wiselinks' event listener for the pushState(?) event while I'm making the change, and then re-enable it afterward. Or would it pick up the new URL in the history the moment I re-enable?
The text was updated successfully, but these errors were encountered:
However, there is a small pitfall in storing no_wiselinks (or skipLoadingPage in my case) in the state data object. If you continue and use the back button afterwards, your page won't be loaded because the data.no_wiselinks is still set. Therefore I implemented the feature like this
originalCall = window._Wiselinks.Page.prototype._call
window._Wiselinks.Page.prototype._call = (state) ->
return if Wiselinks.skipLoadingPage
originalCall.apply(this, arguments)
Wiselinks.skipLoadingPage = true
# do your state changes
Wiselinks.skipLoadingPage = false
However, there is a small pitfall in storing no_wiselinks (or
skipLoadingPage in my case) in the state data object. If you continue and
use the back button afterwards, your page won't be loaded because the
data.no_wiselinks is still set. Therefore I implemented the feature like
this
Hello!
Wiselinks has been pretty much perfect for my application, but I have a situation where I'd like to push information into the History stack without causing a reload (namely, 'pagination' via infinite scroll)
What I want to do is:
User goes to
http://example.org/home
and then scrolls down a ways, and a second page of content is loaded. I want the url in the title bar and the History stack to reflect this:
http://example.org/home?page=2
What currently happens, though, is that when I attempt to change history:
wiselinks kicks in and replaces my existing content with the content of page 2.
I'm thinking that I just need to provide a way to disable wiselinks' event listener for the pushState(?) event while I'm making the change, and then re-enable it afterward. Or would it pick up the new URL in the history the moment I re-enable?
The text was updated successfully, but these errors were encountered: