Created
August 3, 2012 22:31
-
-
Save ferclaverino/3252190 to your computer and use it in GitHub Desktop.
Modify navigation
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
// 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