mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
Toderp signup and nav controller fixes
This commit is contained in:
25
js/ext/angular/src/directive/ionicNav.js
vendored
25
js/ext/angular/src/directive/ionicNav.js
vendored
@ -24,6 +24,12 @@ angular.module('ionic.ui.nav', ['ionic.service'])
|
||||
navBar: {
|
||||
shouldGoBack: function() {
|
||||
},
|
||||
show: function() {
|
||||
this.isVisible = true;
|
||||
},
|
||||
hide: function() {
|
||||
this.isVisible = false;
|
||||
},
|
||||
setTitle: function(title) {
|
||||
$scope.navController.title = title;
|
||||
},
|
||||
@ -57,15 +63,16 @@ angular.module('ionic.ui.nav', ['ionic.service'])
|
||||
.directive('navBar', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
require: '^navController',
|
||||
require: '^navCtrl',
|
||||
transclude: true,
|
||||
replace: true,
|
||||
scope: true,
|
||||
template: '<header class="bar bar-header bar-dark nav-bar" ng-class="{hidden: isHidden}">' +
|
||||
'<a href="#" ng-click="goBack()" class="button" ng-if="controllers.length > 1">Back</a>' +
|
||||
'<h1 class="title">{{getTopController().title}}</h1>' +
|
||||
template: '<header class="bar bar-header bar-dark nav-bar" ng-class="{hidden: !navController.navBar.isVisible}">' +
|
||||
'<a href="#" ng-click="goBack()" class="button" ng-if="navController.controllers.length > 1">Back</a>' +
|
||||
'<h1 class="title">{{navController.getTopController().title}}</h1>' +
|
||||
'</header>',
|
||||
link: function(scope, element, attrs, navCtrl) {
|
||||
scope.navController = navCtrl;
|
||||
scope.goBack = function() {
|
||||
navCtrl.pop();
|
||||
}
|
||||
@ -76,9 +83,17 @@ angular.module('ionic.ui.nav', ['ionic.service'])
|
||||
.directive('navContent', function() {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
require: '^navCtrl',
|
||||
scope: true,
|
||||
link: function(scope, element, attrs) {
|
||||
link: function(scope, element, attrs, navCtrl) {
|
||||
scope.title = attrs.title;
|
||||
|
||||
if(attrs.navBar === "false") {
|
||||
navCtrl.hideNavBar();
|
||||
} else {
|
||||
navCtrl.showNavBar();
|
||||
}
|
||||
|
||||
scope.isVisible = true;
|
||||
scope.pushController(scope);
|
||||
|
||||
|
||||
@ -40,12 +40,12 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav-controller>
|
||||
<nav-ctrl>
|
||||
<nav-bar></nav-bar>
|
||||
|
||||
<content has-header="true" ng-controller="AppCtrl" class="reveal-animation">
|
||||
</content>
|
||||
</nav-controller>
|
||||
</nav-ctrl>
|
||||
|
||||
<script src="../../../../dist/ionic.js"></script>
|
||||
<script src="../../../../dist/ionic-angular.js"></script>
|
||||
@ -64,7 +64,7 @@
|
||||
'</div>')(childScope, cb);
|
||||
}
|
||||
|
||||
angular.module('navTest', ['ionic.ui'])
|
||||
angular.module('navTest', ['ionic.ui.nav'])
|
||||
|
||||
.controller('AppCtrl', function($scope, $compile, $element) {
|
||||
pushIt($scope, $compile, $element, function(cloned, scope) {
|
||||
|
||||
Reference in New Issue
Block a user