Skip to content

Commit f656672

Browse files
committed
feat(header): remove bottom border when tabs top
1 parent 71f788e commit f656672

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

Diff for: js/angular/controller/navBarController.js

+5
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ function($scope, $element, $attrs, $compile, $timeout, $ionicNavBarDelegate, $io
410410
};
411411

412412

413+
self.hasTabsTop = function(isTabsTop) {
414+
$element[isTabsTop ? 'addClass' : 'removeClass']('nav-bar-tabs-top');
415+
};
416+
417+
413418
// DEPRECATED, as of v1.0.0-beta14 -------
414419
self.changeTitle = function(val) {
415420
deprecatedWarning('changeTitle(val)', 'title(val)');

Diff for: js/angular/controller/navViewController.js

+7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
5555
});
5656

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

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

428429

430+
function onTabsTop(ev, isTabsTop) {
431+
var associatedNavBarCtrl = getAssociatedNavBarCtrl();
432+
associatedNavBarCtrl && associatedNavBarCtrl.hasTabsTop(isTabsTop);
433+
}
434+
435+
429436
function getAssociatedNavBarCtrl() {
430437
if (navBarDelegate) {
431438
for (var x=0; x < $ionicNavBarDelegate._instances.length; x++) {

Diff for: js/angular/directive/tabs.js

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function($ionicTabsDelegate, $ionicConfig, $ionicHistory) {
8080
var isHidden = value.indexOf('tabs-item-hide') !== -1;
8181
$scope.$hasTabs = !isTabsTop && !isHidden;
8282
$scope.$hasTabsTop = isTabsTop && !isHidden;
83+
$scope.$emit('$ionicTabs.top', $scope.$hasTabsTop);
8384
});
8485

8586
function emitLifecycleEvent(ev, data) {

Diff for: scss/_bar.scss

+5
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,8 @@
393393
.bar .buttons .hide {
394394
display: none;
395395
}
396+
397+
.nav-bar-tabs-top .bar {
398+
background-image: none;
399+
}
400+

0 commit comments

Comments
 (0)