Skip to content

Commit

Permalink
feat(header): remove bottom border when tabs top
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Mar 4, 2015
1 parent 71f788e commit f656672
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/angular/controller/navBarController.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
};


self.hasTabsTop = function(isTabsTop) {
$element[isTabsTop ? 'addClass' : 'removeClass']('nav-bar-tabs-top');
};


// DEPRECATED, as of v1.0.0-beta14 -------
self.changeTitle = function(val) {
deprecatedWarning('changeTitle(val)', 'title(val)');
Expand Down
7 changes: 7 additions & 0 deletions js/angular/controller/navViewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
});

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

ionic.Platform.ready(function() {
if (ionic.Platform.isWebView() && $ionicConfig.views.swipeBackEnabled()) {
Expand Down Expand Up @@ -426,6 +427,12 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
}


function onTabsTop(ev, isTabsTop) {
var associatedNavBarCtrl = getAssociatedNavBarCtrl();
associatedNavBarCtrl && associatedNavBarCtrl.hasTabsTop(isTabsTop);
}


function getAssociatedNavBarCtrl() {
if (navBarDelegate) {
for (var x=0; x < $ionicNavBarDelegate._instances.length; x++) {
Expand Down
1 change: 1 addition & 0 deletions js/angular/directive/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function($ionicTabsDelegate, $ionicConfig, $ionicHistory) {
var isHidden = value.indexOf('tabs-item-hide') !== -1;
$scope.$hasTabs = !isTabsTop && !isHidden;
$scope.$hasTabsTop = isTabsTop && !isHidden;
$scope.$emit('$ionicTabs.top', $scope.$hasTabsTop);
});

function emitLifecycleEvent(ev, data) {
Expand Down
5 changes: 5 additions & 0 deletions scss/_bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,8 @@
.bar .buttons .hide {
display: none;
}

.nav-bar-tabs-top .bar {
background-image: none;
}

0 comments on commit f656672

Please sign in to comment.