Hide nav bar if you like.

This commit is contained in:
Max Lynch
2013-10-01 23:41:57 -05:00
parent 9c5f78b9f3
commit fb85b7e91c
7 changed files with 51 additions and 24 deletions

View File

@ -77,11 +77,13 @@ 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>',
link: function(scope, element, attrs, navCtrl) {
scope.isHidden = attrs.hidden;
scope.goBack = function() {
navCtrl.pop();
}

24
dist/ionic-ios7.css vendored
View File

@ -1,4 +1,3 @@
@charset "UTF-8";
/**
* Adapted from normalize.css and some reset.css. We don't care even one
* bit about old IE, so we don't need any hacks for that in here.
@ -182,7 +181,7 @@ sub {
fieldset {
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
border: 1px solid silver; }
border: 1px solid #c0c0c0; }
/**
* 1. Correct `color` not being inherited in IE 8/9.
@ -373,6 +372,9 @@ body {
.platform-ios7 .has-header {
margin-top: 64px; }
.hidden, .hide {
display: none !important; }
.padded {
padding: 10px; }
@ -1771,7 +1773,7 @@ select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted #333333;
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; }
@ -1858,7 +1860,7 @@ input[type="checkbox"][readonly] {
right: 20px;
transition: 0.2s ease;
transition-property: left, right;
transition-delay: 0s, 0.05s; }
transition-delay: 0s, .05s; }
.toggle :checked + .track {
/* When the toggle is "on" */
@ -1873,7 +1875,7 @@ input[type="checkbox"][readonly] {
right: 0;
left: 20px;
-webkit-transform: none;
transition-delay: 0.05s, 0s; }
transition-delay: .05s, 0s; }
/* hide a radio button's icon by default */
.radio-item [class^="icon-"],
@ -2050,7 +2052,7 @@ input[type="checkbox"][readonly] {
border: none;
background: none; }
.button.button-icon:active, .button.button-icon.active {
text-shadow: 0px 0px 10px white;
text-shadow: 0px 0px 10px #fff;
box-shadow: none;
background: none; }
@ -2233,7 +2235,7 @@ a.button {
width: 100%;
background-color: white;
border-radius: 2px;
border: 1px solid #dddddd; }
border: 1px solid #ddd; }
.card-header {
padding: 10px;
@ -2269,8 +2271,8 @@ a.button {
}
*/
.slide-in-up.enter {
-webkit-transition: -webkit-transform 0.4s, opacity 0.4s;
transition: transform 0.4s, opacity 0.4s;
-webkit-transition: -webkit-transform .4s, opacity .4s;
transition: transform .4s, opacity .4s;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
-webkit-transition-timing-function: cubic-bezier(0.1, 0.7, 0.1, 1); }
@ -2278,8 +2280,8 @@ a.button {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.slide-in-up.leave {
-webkit-transition: -webkit-transform 0.25s, opacity 0.25s;
transition: transform 0.25s, opacity 0.25s; }
-webkit-transition: -webkit-transform .25s, opacity .25s;
transition: transform .25s, opacity .25s; }
.slide-in-up.leave-active {
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0); }

20
dist/ionic.css vendored
View File

@ -1,4 +1,3 @@
@charset "UTF-8";
@font-face {
font-family: 'ionicon-test';
src: url("fonts/ionicon-test.eot");
@ -247,7 +246,7 @@ sub {
fieldset {
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
border: 1px solid silver; }
border: 1px solid #c0c0c0; }
/**
* 1. Correct `color` not being inherited in IE 8/9.
@ -431,6 +430,9 @@ body {
background-color: #fff;
-webkit-overflow-scrolling: touch; }
.hidden, .hide {
display: none !important; }
.padded {
padding: 10px; }
@ -1829,7 +1831,7 @@ select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted #333333;
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; }
@ -2102,7 +2104,7 @@ input[type="checkbox"][readonly] {
border: none;
background: none; }
.button.button-icon:active, .button.button-icon.active {
text-shadow: 0px 0px 10px white;
text-shadow: 0px 0px 10px #fff;
box-shadow: none;
background: none; }
@ -2285,7 +2287,7 @@ a.button {
width: 100%;
background-color: white;
border-radius: 2px;
border: 1px solid #dddddd; }
border: 1px solid #ddd; }
.card-header {
padding: 10px;
@ -2321,8 +2323,8 @@ a.button {
}
*/
.slide-in-up.enter {
-webkit-transition: -webkit-transform 0.4s, opacity 0.4s;
transition: transform 0.4s, opacity 0.4s;
-webkit-transition: -webkit-transform .4s, opacity .4s;
transition: transform .4s, opacity .4s;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
-webkit-transition-timing-function: cubic-bezier(0.1, 0.7, 0.1, 1); }
@ -2330,8 +2332,8 @@ a.button {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.slide-in-up.leave {
-webkit-transition: -webkit-transform 0.25s, opacity 0.25s;
transition: transform 0.25s, opacity 0.25s; }
-webkit-transition: -webkit-transform .25s, opacity .25s;
transition: transform .25s, opacity .25s; }
.slide-in-up.leave-active {
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0); }

10
dist/ionic.js vendored
View File

@ -1737,9 +1737,19 @@ window.ionic = {
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) {

View File

@ -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>',

View File

@ -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) {

View File

@ -1,4 +1,4 @@
.hidden, .hide { display: none !important; }
.padded {
padding: $content-padding;