mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
Hide nav bar if you like.
This commit is contained in:
3
js/ext/angular/src/directive/ionicNav.js
vendored
3
js/ext/angular/src/directive/ionicNav.js
vendored
@ -53,7 +53,8 @@ angular.module('ionic.ui.nav', [])
|
||||
require: '^navController',
|
||||
transclude: true,
|
||||
replace: true,
|
||||
template: '<header class="bar bar-header bar-dark nav-bar">' +
|
||||
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>' +
|
||||
'</header>',
|
||||
|
||||
@ -5,9 +5,19 @@
|
||||
this.el = opts.el;
|
||||
|
||||
this._titleEl = this.el.querySelector('.title');
|
||||
|
||||
if(opts.hidden) {
|
||||
this.hide();
|
||||
}
|
||||
};
|
||||
|
||||
ionic.views.NavBar.prototype = {
|
||||
hide: function() {
|
||||
this.el.classList.add('hidden');
|
||||
},
|
||||
show: function() {
|
||||
this.el.classList.remove('hidden');
|
||||
},
|
||||
shouldGoBack: function() {},
|
||||
|
||||
setTitle: function(title) {
|
||||
|
||||
Reference in New Issue
Block a user