From 24a415c32dfe922174dd3a36e9b63bd2ea426fd9 Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Tue, 8 Apr 2014 09:35:50 -0600 Subject: [PATCH] feat($ionicNavBarDelegate): showBar returns whether navbar is shown --- js/ext/angular/src/directive/ionicNavBar.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/ext/angular/src/directive/ionicNavBar.js b/js/ext/angular/src/directive/ionicNavBar.js index 2e8560123f..80ebe1f51a 100644 --- a/js/ext/angular/src/directive/ionicNavBar.js +++ b/js/ext/angular/src/directive/ionicNavBar.js @@ -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', /** @@ -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) {