mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(navclear): Ability to disable the next view transition and back button
This commit is contained in:
@@ -2,21 +2,21 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Side Menus</title>
|
||||
|
||||
<!-- Sets initial viewport load and disables zooming -->
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
||||
<script src="../../../../dist/js/ionic.bundle.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div ng-controller="MenuCtrl">
|
||||
|
||||
<ion-side-menus>
|
||||
|
||||
<ion-pane ion-side-menu-content>
|
||||
<header class="bar bar-header bar-assertive">
|
||||
<button class="button button-icon ion-navicon" ng-click="openLeft()"></button>
|
||||
<header class="bar bar-header bar-positive">
|
||||
<button class="button button-icon ion-navicon" ng-click="sideMenuController.toggleLeft(false)"></button>
|
||||
<h1 class="title">Slide me</h1>
|
||||
<button class="button button-icon ion-navicon" ng-click="openRight()"></button>
|
||||
<button class="button button-icon ion-navicon" ng-click="sideMenuController.toggleRight(false)"></button>
|
||||
</header>
|
||||
<ion-content class="has-header">
|
||||
<ion-toggle ng-model="$root.$draggy">Hello</ion-toggle>
|
||||
@@ -38,8 +38,9 @@
|
||||
</ul>
|
||||
</ion-content>
|
||||
</ion-side-menu>
|
||||
|
||||
<ion-side-menu side="right">
|
||||
<header class="bar bar-header bar-assertive">
|
||||
<header class="bar bar-header bar-royal">
|
||||
<h1 class="title">Right</h1>
|
||||
</header>
|
||||
<ion-content>
|
||||
@@ -50,29 +51,27 @@
|
||||
</ul>
|
||||
</ion-content>
|
||||
</ion-side-menu>
|
||||
|
||||
</ion-side-menus>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
angular.module('sideMenuTest', ['ionic'])
|
||||
|
||||
.controller('MenuCtrl', function($scope, $ionicSideMenuDelegate) {
|
||||
.controller('MenuCtrl', function($scope) {
|
||||
$scope.list = [];
|
||||
for(var i = 0; i < 20; i++) {
|
||||
$scope.list.push({
|
||||
text: 'Item ' + i
|
||||
});
|
||||
}
|
||||
$scope.openLeft = function() {
|
||||
$ionicSideMenuDelegate.toggleLeft($scope);
|
||||
};
|
||||
$scope.openRight = function() {
|
||||
$ionicSideMenuDelegate.toggleRight($scope);
|
||||
};
|
||||
})
|
||||
|
||||
.controller('LeftCtrl', function($scope) {
|
||||
$scope.value = true;
|
||||
$scope.list = [{text:1},{text:2},{text:3}];
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<ion-side-menus>
|
||||
|
||||
<ion-pane ion-side-menu-content>
|
||||
<ion-nav-bar type="bar-positive"
|
||||
<ion-nav-bar class="bar-positive"
|
||||
back-button-type=""
|
||||
back-button-icon="ion-ios7-arrow-back"></ion-nav-bar>
|
||||
<ion-nav-view name="menuContent"></ion-nav-view>
|
||||
@@ -28,8 +28,8 @@
|
||||
</header>
|
||||
<ion-content class="has-header">
|
||||
<div class="list">
|
||||
<a ng-click="closeMenu()" href="#/event/check-in" class="item">Check-in</a>
|
||||
<a ng-click="closeMenu()" href="#/event/attendees" class="item">Attendees</a>
|
||||
<a nav-clear menu-close href="#/event/check-in" class="item">Check-in</a>
|
||||
<a nav-clear menu-close href="#/event/attendees" class="item">Attendees</a>
|
||||
<div class="item item-divider">
|
||||
Range
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@
|
||||
</ion-side-menu>
|
||||
|
||||
<ion-side-menu side="right">
|
||||
<header class="bar bar-header bar-assertive">
|
||||
<header class="bar bar-header bar-royal">
|
||||
<div class="title">Right Menu</div>
|
||||
</header>
|
||||
</ion-side-menu>
|
||||
@@ -52,7 +52,7 @@
|
||||
</script>
|
||||
|
||||
<script id="home.html" type="text/ng-template">
|
||||
<ion-view title="'Welcome'">
|
||||
<ion-view title="Welcome">
|
||||
<ion-content class="has-header" padding="true">
|
||||
<p>Swipe to the right to reveal the left menu.</p>
|
||||
<div class="button" ng-click="sideMenuController.toggleLeft()" style="position: absolute; left: 100px; top: 200px;">
|
||||
@@ -88,7 +88,7 @@
|
||||
</script>
|
||||
|
||||
<script id="check-in.html" type="text/ng-template">
|
||||
<ion-view title="'Event Check-in'" hide-back-button="true">
|
||||
<ion-view title="Check-in" hide-back-button="true">
|
||||
<ion-content class="has-header">
|
||||
<form class="list" ng-show="showForm">
|
||||
<div class="item item-divider">
|
||||
@@ -128,7 +128,7 @@
|
||||
</script>
|
||||
|
||||
<script id="attendees.html" type="text/ng-template">
|
||||
<ion-view title="'Event Attendees'">
|
||||
<ion-view title="Attendees">
|
||||
<ion-content class="has-header">
|
||||
<div class="list">
|
||||
<ion-toggle ng-repeat="attendee in attendees | orderBy:'firstname' | orderBy:'lastname'"
|
||||
|
||||
Reference in New Issue
Block a user