Skip to content

Commit

Permalink
feat($ionicNavBarDelegate): showBar returns whether navbar is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Apr 8, 2014
1 parent c7e3def commit 24a415c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/ext/angular/src/directive/ionicNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ angular.module('ionic.ui.navBar', ['ionic.service.view', 'ngSanitize'])
* @ngdoc method
* @name $ionicNavBarDelegate#showBar
* @description
* Set whether the {@link ionic.directive:ionNavBar} should be shown.
* Set/get whether the {@link ionic.directive:ionNavBar} is shown.
* @param {boolean} show Whether to show the bar.
* @returns {boolean} Whether the bar is shown.
*/
'showBar',
/**
Expand Down Expand Up @@ -143,8 +144,11 @@ function($scope, $element, $attrs, $ionicViewService, $animate, $compile, $ionic
};

this.showBar = function(show) {
$scope.isInvisible = !show;
$scope.$parent.$hasHeader = !!show;
if (arguments.length) {
$scope.isInvisible = !show;
$scope.$parent.$hasHeader = !!show;
}
return !$scope.isInvisible;
};

this.setTitle = function(title) {
Expand Down

0 comments on commit 24a415c

Please sign in to comment.