Skip to content

Instantly share code, notes, and snippets.

@mitechie
Created July 15, 2011 13:56
Show Gist options
  • Save mitechie/1084740 to your computer and use it in GitHub Desktop.
Save mitechie/1084740 to your computer and use it in GitHub Desktop.
/**
* Pop the history stack and run the load function for the page
* requested
*
*/
that.backward = function() {
var new_page;
console.log('BACKWARD');
console.log(that.history);
console.log(that.history.length);
if (that.history.length > 0) {
console.log(that.history);
page = that.history.pop();
$.mobile.pageLoading();
$.mobile.changePage(page.id, 'slide', back=false, changeHash=false);
new_page.load(page.data);
$.mobile.pageLoading(true);
} else {
console.log('back too far, should hopefully be at home page');
// the default page to load is the home page?
new_page = $b.pages.home;
that.manual(new_page, true);
}
};
return that;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment