Toderp signup and nav controller fixes

This commit is contained in:
Max Lynch
2013-10-04 13:31:16 -05:00
parent 065063fc70
commit b12c93f087
8 changed files with 194 additions and 32 deletions

54
dist/ionic.js vendored
View File

@ -2119,6 +2119,16 @@ ionic.views.TabBar.prototype = {
;
(function(ionic) {
/**
* The NavController makes it easy to have a stack
* of views or screens that can be pushed and popped
* for a dynamic navigation flow. This API is modelled
* off of the UINavigationController in iOS.
*
* The NavController can drive a nav bar to show a back button
* if the stack can be poppped to go back to the last view, and
* it will handle updating the title of the nav bar and processing animations.
*/
ionic.controllers.NavController = function(opts) {
var _this = this;
@ -2135,12 +2145,26 @@ ionic.controllers.NavController = function(opts) {
};
ionic.controllers.NavController.prototype = {
/**
* @return {array} the array of controllers on the stack.
*/
getControllers: function() {
return this.controllers;
},
/**
* @return {object} the controller at the top of the stack.
*/
getTopController: function() {
return this.controllers[this.controllers.length-1];
},
/**
* Push a new controller onto the navigation stack. The new controller
* will automatically become the new visible view.
*
* @param {object} controller the controller to push on the stack.
*/
push: function(controller) {
var last = this.controllers[this.controllers.length - 1];
@ -2175,6 +2199,12 @@ ionic.controllers.NavController.prototype = {
return controller;
},
/**
* Pop the top controller off the stack, and show the last one. This is the
* "back" operation.
*
* @return {object} the last popped controller
*/
pop: function() {
var next, last;
@ -2207,8 +2237,27 @@ ionic.controllers.NavController.prototype = {
return last;
},
/**
* Show the NavBar (if any)
*/
showNavBar: function() {
if(this.navBar) {
this.navBar.show();
}
},
/**
* Hide the NavBar (if any)
*/
hideNavBar: function() {
if(this.navBar) {
this.navBar.hide();
}
},
// Update the nav bar after a push or pop
_updateNavBar: function() {
if(!this.getTopController()) {
if(!this.getTopController() || !this.navBar) {
return;
}
@ -2219,8 +2268,7 @@ ionic.controllers.NavController.prototype = {
} else {
this.navBar.showBackButton(false);
}
},
}
};
})(window.ionic);
;