Skip to content

Commit

Permalink
feat(ionTabs): add available tabs-item-hide class
Browse files Browse the repository at this point in the history
Closes #395
  • Loading branch information
ajoslin committed Mar 24, 2014
1 parent 60e4533 commit 5966dbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/ext/angular/src/directive/ionicTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
var el = $element[0];
$scope.$watch(function() { return el.className; }, function(value) {
var isTabsTop = value.indexOf('tabs-top') !== -1;
$scope.$hasTabs = !isTabsTop;
$scope.$hasTabsTop = isTabsTop;
var isHidden = value.indexOf('tabs-item-hide') !== -1;
$scope.$hasTabs = !isTabsTop && !isHidden;
$scope.$hasTabsTop = isTabsTop && !isHidden;
});
$scope.$on('$destroy', function() {
$scope.$hasTabs = $scope.$hasTabsTop = null;
Expand Down
5 changes: 5 additions & 0 deletions scss/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@
}
}

.tabs.tabs-item-hide,
.tabs-item-hide > .tabs {
display: none;
}

.tabs-icon-top .tab-item,
.tabs-icon-bottom .tab-item {
font-size: $tabs-text-font-size-side-icon;
Expand Down

2 comments on commit 5966dbf

@lprsd
Copy link

@lprsd lprsd commented on 5966dbf Aug 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How'd I selectively disable displaying the tabs, say in the login page or so?

@khyamay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 just what I was looking for :)

Please sign in to comment.