Tab bar fixes

This commit is contained in:
Max Lynch
2013-11-19 17:58:14 -06:00
parent d9e2c11afc
commit 79f0c90564
4 changed files with 37 additions and 17 deletions

View File

@ -25494,12 +25494,9 @@ angular.module('ionic.ui.navRouter', [])
$scope.currentTitle = data.title; $scope.currentTitle = data.title;
} }
if(typeof data.leftButtons !== 'undefined') {
$scope.leftButtons = data.leftButtons; $scope.leftButtons = data.leftButtons;
}
if(typeof data.rightButtons !== 'undefined') {
$scope.rightButtons = data.rightButtons; $scope.rightButtons = data.rightButtons;
}
if(typeof data.hideBackButton !== 'undefined') { if(typeof data.hideBackButton !== 'undefined') {
$scope.enableBackButton = data.hideBackButton !== true; $scope.enableBackButton = data.hideBackButton !== true;
} }
@ -25522,6 +25519,19 @@ angular.module('ionic.ui.navRouter', [])
updateHeaderData(data); updateHeaderData(data);
}); });
$scope.$parent.$on('navRouter.titleChanged', function(e, data) {
var oldTitle = $scope.currentTitle;
$scope.oldTitle = oldTitle;
if(data.animate !== false && typeof data.title !== 'undefined') {
animate($scope, $element, oldTitle, data, function() {
hb.align();
});
} else {
hb.align();
}
});
/* /*
$scope.$parent.$on('navigation.push', function() { $scope.$parent.$on('navigation.push', function() {
@ -25582,7 +25592,7 @@ angular.module('ionic.ui.navRouter', [])
var titleGet = $parse($attr.title); var titleGet = $parse($attr.title);
$scope.$watch(titleGet, function(value) { $scope.$watch(titleGet, function(value) {
$scope.title = value; $scope.title = value;
$scope.$emit('navRouter.pageChanged', { $scope.$emit('navRouter.titleChanged', {
title: value, title: value,
animate: $scope.animate animate: $scope.animate
}); });
@ -26027,7 +26037,7 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
$scope.hideBackButton = $scope.$eval($attr.hideBackButton); $scope.hideBackButton = $scope.$eval($attr.hideBackButton);
if($scope.hideBackButton !== true) { if($scope.hideBackButton !== true) {
$scope.hideBackButton = true; $scope.hideBackButton = false;
} }
// Whether we should animate on tab change, also impacts whether we // Whether we should animate on tab change, also impacts whether we

View File

@ -231,12 +231,9 @@ angular.module('ionic.ui.navRouter', [])
$scope.currentTitle = data.title; $scope.currentTitle = data.title;
} }
if(typeof data.leftButtons !== 'undefined') {
$scope.leftButtons = data.leftButtons; $scope.leftButtons = data.leftButtons;
}
if(typeof data.rightButtons !== 'undefined') {
$scope.rightButtons = data.rightButtons; $scope.rightButtons = data.rightButtons;
}
if(typeof data.hideBackButton !== 'undefined') { if(typeof data.hideBackButton !== 'undefined') {
$scope.enableBackButton = data.hideBackButton !== true; $scope.enableBackButton = data.hideBackButton !== true;
} }
@ -259,6 +256,19 @@ angular.module('ionic.ui.navRouter', [])
updateHeaderData(data); updateHeaderData(data);
}); });
$scope.$parent.$on('navRouter.titleChanged', function(e, data) {
var oldTitle = $scope.currentTitle;
$scope.oldTitle = oldTitle;
if(data.animate !== false && typeof data.title !== 'undefined') {
animate($scope, $element, oldTitle, data, function() {
hb.align();
});
} else {
hb.align();
}
});
/* /*
$scope.$parent.$on('navigation.push', function() { $scope.$parent.$on('navigation.push', function() {
@ -319,7 +329,7 @@ angular.module('ionic.ui.navRouter', [])
var titleGet = $parse($attr.title); var titleGet = $parse($attr.title);
$scope.$watch(titleGet, function(value) { $scope.$watch(titleGet, function(value) {
$scope.title = value; $scope.title = value;
$scope.$emit('navRouter.pageChanged', { $scope.$emit('navRouter.titleChanged', {
title: value, title: value,
animate: $scope.animate animate: $scope.animate
}); });

View File

@ -110,7 +110,7 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
$scope.hideBackButton = $scope.$eval($attr.hideBackButton); $scope.hideBackButton = $scope.$eval($attr.hideBackButton);
if($scope.hideBackButton !== true) { if($scope.hideBackButton !== true) {
$scope.hideBackButton = true; $scope.hideBackButton = false;
} }
// Whether we should animate on tab change, also impacts whether we // Whether we should animate on tab change, also impacts whether we

View File

@ -17,7 +17,7 @@
</pane> </pane>
<script id="page1.html" type="text/ng-template"> <script id="page1.html" type="text/ng-template">
<nav-page hide-back-button="true"> <nav-page>
<tabs tabs-style="tabs-icon-top" tabs-type="tabs-positive" animate-nav="false"> <tabs tabs-style="tabs-icon-top" tabs-type="tabs-positive" animate-nav="false">