Created
July 15, 2011 13:56
-
-
Save mitechie/1084740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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