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
Single page support? #127
Comments
I was surprised there was no mention on this in the docs. Seems like a fairly common pattern these days. There should be a programmatic way to change pages. |
totally agree. coupling a widget framework to a particular brand of page fetching can only lead to bad things. Can we get some dev love for this? |
Push.js hardly solved what I needed for my mobile web app, but it is an awesome start nonetheless. Some things I added include an 'beforepush' event, a 'filter' event for the data, a data-ignore="push-history" attribute, and I'm currently working on a prefetching method. |
👍 |
+1 This pattern is taking over the multi-page approach! |
I guess that the first step would be making the swapContent function public. Not sure if it's enough, though. |
FWIMC - the following proof of concept slides the provided Backbone view into view: PUSH.replaceWithView = function(view) {
var dom = view.el, key, selector, barElement, newBarElement;
for (key in bars) {
selector = bars[key];
barElement = document.querySelector(selector);
newBarElement = dom.querySelector(selector);
if (newBarElement) {
swapContent(newBarElement, barElement);
newBarElement.parentNode.removeChild(newBarElement);
}
else if (barElement) {
barElement.parentNode.removeChild(barElement);
}
}
selector = '.content';
swapContent(dom.querySelector(selector), document.querySelector(selector), 'slidein');
} |
I did this by extracting the code out of
With that, it is easy to do the transition manually. First, remove the footer since it does not support transitions. Then apply the classes to the old content like:
This requires you to have |
Just found this old thread. I've submitted a pull request to extract & expose the transition functionality from |
Is there a way to use the push.js transition features with a single page system (ie backbone)?
Transitioning in a new div?
The text was updated successfully, but these errors were encountered: