Skip to content

Commit 0c3d1bf

Browse files
committed
Fixed #166
1 parent a8bb330 commit 0c3d1bf

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

dist/js/ionic-angular.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,10 +1429,12 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
14291429
return;
14301430
}
14311431

1432-
if(back) {
1433-
reverseTransition();
1434-
} else {
1435-
forwardTransition();
1432+
if($rootScope.stackCursorPosition > 0) {
1433+
if(back) {
1434+
reverseTransition();
1435+
} else {
1436+
forwardTransition();
1437+
}
14361438
}
14371439
});
14381440

@@ -1450,7 +1452,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
14501452
$scope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) {
14511453
if($rootScope.actualLocation === newLocation) {
14521454

1453-
if(oldLocation == '' && newLocation == '/') {
1455+
if(oldLocation == '' || newLocation == '/') {
14541456
// initial route, skip this
14551457
return;
14561458
}
@@ -1580,8 +1582,6 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
15801582
$element.addClass($scope.type);
15811583

15821584
var updateHeaderData = function(data) {
1583-
console.log('Header data changed', data);
1584-
15851585
var oldTitle = $scope.currentTitle;
15861586
$scope.oldTitle = oldTitle;
15871587

js/ext/angular/src/directive/ionicNavRouter.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
7171
return;
7272
}
7373

74-
if(back) {
75-
reverseTransition();
76-
} else {
77-
forwardTransition();
74+
if($rootScope.stackCursorPosition > 0) {
75+
if(back) {
76+
reverseTransition();
77+
} else {
78+
forwardTransition();
79+
}
7880
}
7981
});
8082

@@ -92,7 +94,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
9294
$scope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) {
9395
if($rootScope.actualLocation === newLocation) {
9496

95-
if(oldLocation == '' && newLocation == '/') {
97+
if(oldLocation == '' || newLocation == '/') {
9698
// initial route, skip this
9799
return;
98100
}
@@ -222,8 +224,6 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
222224
$element.addClass($scope.type);
223225

224226
var updateHeaderData = function(data) {
225-
console.log('Header data changed', data);
226-
227227
var oldTitle = $scope.currentTitle;
228228
$scope.oldTitle = oldTitle;
229229

js/ext/angular/test/navRouter.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h1>Page 3</h1>
4646

4747

4848
.config(function($routeProvider, $locationProvider) {
49-
$routeProvider.when('/', {
49+
$routeProvider.when('/cats', {
5050
templateUrl: 'page1.html',
5151
controller: 'Page1Ctrl'
5252
});
@@ -59,6 +59,10 @@ <h1>Page 3</h1>
5959
templateUrl: 'page3.html',
6060
});
6161

62+
$routeProvider.otherwise({
63+
redirectTo: '/cats'
64+
});
65+
6266
// configure html5 to get links working on jsfiddle
6367
//$locationProvider.html5Mode(true);
6468

scss/_platform.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
.has-subheader {
2525
top: 108px;
2626
}
27-
}
27+
}

0 commit comments

Comments
 (0)