mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed up some nav stuff
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: black;
|
||||
}
|
||||
.slide-in-slide-out {
|
||||
/*
|
||||
@@ -28,22 +27,21 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<navs>
|
||||
<nav-bar type="bar-primary" back-button-type="button-pure" align-title="left">
|
||||
<navigation first="page.html">
|
||||
<nav-bar type="bar-primary" back-button-type="button-pure button-icon" back-button-icon="ion-arrow-left-c">
|
||||
</nav-bar>
|
||||
|
||||
<div ng-controller="AppCtrl">
|
||||
<content has-header="true">
|
||||
</content>
|
||||
</div>
|
||||
</navs>
|
||||
</navigation>
|
||||
|
||||
<script id="page.html" type="text/ng-template">
|
||||
<div title="Home home home home home home home home home" ng-controller="CatsCtrl" class="nav-content">
|
||||
<h1></h1>
|
||||
<a href="#" class="button button-royal" ng-click="goNext()">Next</a>
|
||||
<button class="button button-assertive" ng-click="thisThing()">Doit</button>
|
||||
<list><list-item ng-repeat="item in items" on-select="goNext()">Test</list-item></list>
|
||||
<div title="title" class="nav-page">
|
||||
<div ng-controller="CatsCtrl">
|
||||
<content has-header="true">
|
||||
<h1></h1>
|
||||
<a href="#" class="button button-royal" nav-push="page.html">Next</a>
|
||||
<button class="button button-assertive" ng-click="thisThing()">Doit</button>
|
||||
<list><list-item ng-repeat="item in items" on-select="goNext()">Test</list-item></list>
|
||||
</content>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@@ -68,9 +66,6 @@
|
||||
|
||||
angular.module('navTest', ['ionic', 'ngAnimate'])
|
||||
|
||||
.controller('AppCtrl', function($scope, $compile, $element) {
|
||||
$scope.navController.pushFromTemplate('page.html');
|
||||
})
|
||||
|
||||
.controller('CatsCtrl', function($scope, $compile, $element) {
|
||||
$scope.$on('navContent.shown', function() {
|
||||
|
||||
83
js/ext/angular/test/navPush.html
Normal file
83
js/ext/angular/test/navPush.html
Normal file
@@ -0,0 +1,83 @@
|
||||
<html ng-app="navTest">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Nav Bars</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link href="/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
||||
<style>
|
||||
.view {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: black;
|
||||
}
|
||||
.slide-in-slide-out {
|
||||
/*
|
||||
-webkit-transform: translate3d(0%, 0, 0);
|
||||
transform: translate3d(0%, 0, 0);
|
||||
|
||||
-webkit-transition: -webkit-transform 1s ease-in-out;
|
||||
transition: transform 1s ease-in-out;
|
||||
*/
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="../../../../dist/js/ionic.js"></script>
|
||||
<script src="../../../../dist/js/ionic-angular.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<navigation first="page.html">
|
||||
<nav-bar type="bar-primary" back-button-type="button-pure" align-title="left">
|
||||
</nav-bar>
|
||||
</navigation>
|
||||
|
||||
<script id="page.html" type="text/ng-template">
|
||||
<div title="title" class="nav-page">
|
||||
<div ng-controller="CatsCtrl">
|
||||
<content has-header="true">
|
||||
{{secretNumber}}
|
||||
<list><item ng-repeat="item in items" nav-push="page.html">{{item.t}}</item></list>
|
||||
<button nav-push="page.html" class="button button-assertive">Do it</button>
|
||||
</content>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
angular.module('navTest', ['ionic', 'ngAnimate'])
|
||||
|
||||
.controller('CatsCtrl', function($scope, $compile, $element) {
|
||||
$scope.$on('navContent.shown', function() {
|
||||
console.log('SHOWN');
|
||||
});
|
||||
$scope.$on('navContent.hidden', function() {
|
||||
console.log('HIDDEN');
|
||||
});
|
||||
|
||||
$scope.secretNumber = Math.floor(Math.random() * 100);
|
||||
|
||||
$scope.doit = function() { alert('waht'); };
|
||||
|
||||
var items = [
|
||||
{t: 'This one'},
|
||||
{t: 'Hmm, maybe this one'},
|
||||
{t: 'Not that one, this one'},
|
||||
{t: 'Um, this one?'},
|
||||
{t: 'No, this one'}
|
||||
];
|
||||
items = items.sort(function() {
|
||||
return .5 - Math.random();
|
||||
});
|
||||
$scope.items = items;
|
||||
$scope.goNext = function() {
|
||||
$scope.navController.pushFromTemplate('page.html');
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user