Skip to content

Commit

Permalink
fix(subHeader): removes borders on android subheaders
Browse files Browse the repository at this point in the history
Closes #3265
  • Loading branch information
mhartington committed Mar 11, 2015
1 parent c18c69f commit ebe3226
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/angular/controller/navBarController.js
Expand Up @@ -414,6 +414,9 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
$element[isTabsTop ? 'addClass' : 'removeClass']('nav-bar-tabs-top');
};

self.hasBarSubheader = function(isBarSubheader) {
$element[isBarSubheader ? 'addClass' : 'removeClass']('nav-bar-has-subheader');
};

// DEPRECATED, as of v1.0.0-beta14 -------
self.changeTitle = function(val) {
Expand Down
5 changes: 5 additions & 0 deletions js/angular/controller/navViewController.js
Expand Up @@ -56,6 +56,7 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,

$scope.$on('$ionicHistory.deselect', self.cacheCleanup);
$scope.$on('$ionicTabs.top', onTabsTop);
$scope.$on('$ionicSubheader', onBarSubheader);

ionic.Platform.ready(function() {
if (ionic.Platform.isWebView() && $ionicConfig.views.swipeBackEnabled()) {
Expand Down Expand Up @@ -432,6 +433,10 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
associatedNavBarCtrl && associatedNavBarCtrl.hasTabsTop(isTabsTop);
}

function onBarSubheader(ev, isBarSubheader) {
var associatedNavBarCtrl = getAssociatedNavBarCtrl();
associatedNavBarCtrl && associatedNavBarCtrl.hasBarSubheader(isBarSubheader);
}

function getAssociatedNavBarCtrl() {
if (navBarDelegate) {
Expand Down
1 change: 1 addition & 0 deletions js/angular/directive/headerFooterBar.js
Expand Up @@ -137,6 +137,7 @@ function headerFooterBarDirective(isHeader) {
var isSubheader = value.indexOf('bar-subheader') !== -1;
$scope.$hasHeader = isShown && !isSubheader;
$scope.$hasSubheader = isShown && isSubheader;
$scope.$emit('$ionicSubheader', $scope.$hasSubheader);
});
$scope.$on('$destroy', function() {
delete $scope.$hasHeader;
Expand Down
4 changes: 4 additions & 0 deletions scss/_bar.scss
Expand Up @@ -264,6 +264,10 @@

.platform-android {

.nav-bar-has-subheader .bar {
border-bottom: 0;
}

.bar {

.back-button .icon:before {
Expand Down

0 comments on commit ebe3226

Please sign in to comment.