Skip to content

Instantly share code, notes, and snippets.

@ferclaverino
Created August 3, 2012 22:31
Show Gist options
  • Save ferclaverino/3252190 to your computer and use it in GitHub Desktop.
Save ferclaverino/3252190 to your computer and use it in GitHub Desktop.
Modify navigation
// This function updates application controls once a navigation
// has completed.
navigated: function () {
// Do application specific on-navigated work here
var backButton = this.pageElement.querySelector("header[role=banner] .win-backbutton");
var forceShowBack = false;
if (backButton) {
// Si estoy en una sección, entonces el back es a la home
if (nav.location == "pages/section/groupDetailPage.html" || nav.location == "pages/video/landingVideoSection.html") {
backButton.onclick = function () { nav.navigate("/pages/home/landingHome.html");; };
forceShowBack = true
} else {
backButton.onclick = function () { nav.back(); };
}
if (nav.canGoBack || forceShowBack) {
backButton.removeAttribute("disabled");
} else {
backButton.setAttribute("disabled", "disabled");
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment