mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
update so first nav will transition
This commit is contained in:
19
dist/js/ionic-angular.js
vendored
19
dist/js/ionic-angular.js
vendored
@@ -1412,12 +1412,12 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
|
||||
this.goBack = function() {
|
||||
$scope.direction = 'back';
|
||||
}
|
||||
};
|
||||
}],
|
||||
|
||||
link: function($scope, $element, $attr) {
|
||||
if(!$element.length) return;
|
||||
|
||||
|
||||
$scope.animation = $attr.animation;
|
||||
|
||||
$element[0].classList.add('noop-animation');
|
||||
@@ -1452,6 +1452,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
|
||||
if(isFirst || (next && next.$$route && next.$$route.originalPath === "")) {
|
||||
// Don't animate
|
||||
isFirst = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1476,9 +1477,9 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
|
||||
// Keep track of location changes and update a stack pointer that tracks whether we are
|
||||
// going forwards or back
|
||||
$scope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) {
|
||||
$scope.$watch(function () { return $location.path(); }, function (newLocation, oldLocation) {
|
||||
if($rootScope.actualLocation === newLocation) {
|
||||
if(oldLocation == '') {// || newLocation == '/') {
|
||||
if(oldLocation === '') {// || newLocation == '/') {
|
||||
// initial route, skip this
|
||||
return;
|
||||
}
|
||||
@@ -1511,7 +1512,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}])
|
||||
|
||||
/**
|
||||
@@ -1559,7 +1560,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
backButtonType: '@',
|
||||
backButtonLabel: '@',
|
||||
backButtonIcon: '@',
|
||||
alignTitle: '@',
|
||||
alignTitle: '@'
|
||||
},
|
||||
template: '<header class="bar bar-header nav-bar" ng-class="{hidden: !navController.navBar.isVisible}">' +
|
||||
'<div class="buttons"> ' +
|
||||
@@ -1583,7 +1584,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
$scope.backButtonContent += '<i class="icon ' + $scope.backButtonIcon + '"></i>';
|
||||
}
|
||||
if($scope.backButtonLabel) {
|
||||
$scope.backButtonContent += ' ' + $scope.backButtonLabel
|
||||
$scope.backButtonContent += ' ' + $scope.backButtonLabel;
|
||||
}
|
||||
|
||||
// Listen for changes in the stack cursor position to indicate whether a back
|
||||
@@ -1726,7 +1727,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
}])
|
||||
|
||||
.directive('navBack', ['$window', '$rootScope', 'Gesture', function($window, $rootScope, Gesture) {
|
||||
@@ -1747,7 +1748,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
};
|
||||
$element.bind('click', goBack);
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
})();
|
||||
|
||||
19
js/ext/angular/src/directive/ionicNavRouter.js
vendored
19
js/ext/angular/src/directive/ionicNavRouter.js
vendored
@@ -37,12 +37,12 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
|
||||
this.goBack = function() {
|
||||
$scope.direction = 'back';
|
||||
}
|
||||
};
|
||||
}],
|
||||
|
||||
link: function($scope, $element, $attr) {
|
||||
if(!$element.length) return;
|
||||
|
||||
|
||||
$scope.animation = $attr.animation;
|
||||
|
||||
$element[0].classList.add('noop-animation');
|
||||
@@ -77,6 +77,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
|
||||
if(isFirst || (next && next.$$route && next.$$route.originalPath === "")) {
|
||||
// Don't animate
|
||||
isFirst = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,9 +102,9 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
|
||||
// Keep track of location changes and update a stack pointer that tracks whether we are
|
||||
// going forwards or back
|
||||
$scope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) {
|
||||
$scope.$watch(function () { return $location.path(); }, function (newLocation, oldLocation) {
|
||||
if($rootScope.actualLocation === newLocation) {
|
||||
if(oldLocation == '') {// || newLocation == '/') {
|
||||
if(oldLocation === '') {// || newLocation == '/') {
|
||||
// initial route, skip this
|
||||
return;
|
||||
}
|
||||
@@ -136,7 +137,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}])
|
||||
|
||||
/**
|
||||
@@ -184,7 +185,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
backButtonType: '@',
|
||||
backButtonLabel: '@',
|
||||
backButtonIcon: '@',
|
||||
alignTitle: '@',
|
||||
alignTitle: '@'
|
||||
},
|
||||
template: '<header class="bar bar-header nav-bar" ng-class="{hidden: !navController.navBar.isVisible}">' +
|
||||
'<div class="buttons"> ' +
|
||||
@@ -208,7 +209,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
$scope.backButtonContent += '<i class="icon ' + $scope.backButtonIcon + '"></i>';
|
||||
}
|
||||
if($scope.backButtonLabel) {
|
||||
$scope.backButtonContent += ' ' + $scope.backButtonLabel
|
||||
$scope.backButtonContent += ' ' + $scope.backButtonLabel;
|
||||
}
|
||||
|
||||
// Listen for changes in the stack cursor position to indicate whether a back
|
||||
@@ -351,7 +352,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
}])
|
||||
|
||||
.directive('navBack', ['$window', '$rootScope', 'Gesture', function($window, $rootScope, Gesture) {
|
||||
@@ -372,7 +373,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
};
|
||||
$element.bind('click', goBack);
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user