fix(backButton): Do not show back button if no attributes set, closes #549

This commit is contained in:
Adam Bradley
2014-02-06 20:31:45 -06:00
parent 2ac71aa8ee
commit 2d39418d0b
2 changed files with 10 additions and 2 deletions

View File

@@ -95,7 +95,8 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
if(tAttrs.type) tElement.addClass(tAttrs.type);
return function link($scope, $element, $attr) {
$scope.enableBackButton = true;
var canHaveBackButton = !(!tAttrs.backButtonType && !tAttrs.backButtonLabel);
$scope.enableBackButton = canHaveBackButton;
$rootScope.$on('viewState.showNavBar', function(e, showNavBar) {
if(showNavBar === false) {
@@ -121,7 +122,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
$scope.rightButtons = data.rightButtons;
if(typeof data.hideBackButton !== 'undefined') {
$scope.enableBackButton = data.hideBackButton !== true;
$scope.enableBackButton = data.hideBackButton !== true && canHaveBackButton;
}
if(data.animate !== false && $attr.animation && data.title && data.navDirection) {