Added endless scroll (closed #5)

The code for paged collections now feels like playing ping-pong with
callbacks, and like I have no idea on who should render who.

It works, though.
This commit is contained in:
Marcin Kurczewski
2014-09-12 22:58:07 +02:00
parent 0828a0aa89
commit 12b43b1bb8
5 changed files with 170 additions and 108 deletions

View File

@ -14,6 +14,15 @@ App.Router = function(pathJs, _, jQuery, util, appState, presenterManager) {
window.location.href = url;
}
function navigateInplace(url) {
if ('replaceState' in history) {
history.replaceState('', '', url);
pathJs.dispatch(document.location.hash);
} else {
navigate(url);
}
}
function start() {
pathJs.listen();
}
@ -54,6 +63,7 @@ App.Router = function(pathJs, _, jQuery, util, appState, presenterManager) {
return {
start: start,
navigate: navigate,
navigateInplace: navigateInplace,
navigateToMainPage: navigateToMainPage,
};