File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -29,19 +29,23 @@ export class TabButton extends Ion {
29
29
private hasTitleOnly : boolean ;
30
30
private hasIconOnly : boolean ;
31
31
private hasBadge : boolean ;
32
+ private _layout : string ;
32
33
33
34
@Input ( ) tab : Tab ;
34
35
@Output ( ) select : EventEmitter < Tab > = new EventEmitter ( ) ;
35
36
36
37
constructor ( config : Config , elementRef : ElementRef ) {
37
38
super ( elementRef ) ;
38
39
this . disHover = ( config . get ( 'hoverCSS' ) === false ) ;
40
+ this . _layout = config . get ( 'tabbarLayout' ) ;
39
41
}
40
42
41
43
ngOnInit ( ) {
42
44
this . tab . btn = this ;
45
+ this . _layout = this . tab . parent . tabbarLayout || this . _layout ;
46
+
43
47
this . hasTitle = ! ! this . tab . tabTitle ;
44
- this . hasIcon = ! ! this . tab . tabIcon ;
48
+ this . hasIcon = ! ! this . tab . tabIcon && this . _layout != 'icon-hide' ;
45
49
this . hasTitleOnly = ( this . hasTitle && ! this . hasIcon ) ;
46
50
this . hasIconOnly = ( this . hasIcon && ! this . hasTitle ) ;
47
51
this . hasBadge = ! ! this . tab . tabBadge ;
Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ tab-highlight {
159
159
right : calc (50% - 30px );
160
160
}
161
161
162
- [tabbarLayout = icon-hide ] .tab-badge ,
163
162
[tabbarLayout = icon-bottom ] .tab-badge ,
164
163
[tabbarLayout = icon-left ] .tab-badge ,
165
164
[tabbarLayout = icon-right ] .tab-badge {
Original file line number Diff line number Diff line change 32
32
33
33
34
34
<!-- Icons right of text -->
35
- < ion-tabs tabbarLayout ="icon-right " no-navbar >
35
+ < ion-tabs tabbarLayout ="icon-right " primary no-navbar >
36
36
< ion-tab tabTitle ="Recents " tabIcon ="call "> </ ion-tab >
37
37
< ion-tab tabTitle ="Favorites " tabIcon ="heart "> </ ion-tab >
38
38
< ion-tab tabTitle ="Settings " tabIcon ="settings " tabBadge ="1030 " tabBadgeStyle ="light "> </ ion-tab >
45
45
< ion-tab tabTitle ="Settings " tabIcon ="settings "> </ ion-tab >
46
46
</ ion-tabs >
47
47
48
+ <!-- No icons -->
49
+ < ion-tabs no-navbar tabbarLayout ="icon-hide ">
50
+ < ion-tab tabTitle ="Recents " tabIcon ="call " [root] ="root "> </ ion-tab >
51
+ < ion-tab tabTitle ="Favorites " tabIcon ="heart " [root] ="root " tabBadge ="4 "> </ ion-tab >
52
+ < ion-tab tabTitle ="Settings " tabIcon ="settings " [root] ="root "> </ ion-tab >
53
+ </ ion-tabs >
54
+
55
+
56
+ <!-- No title -->
57
+ < ion-tabs tabbarLayout ="title-hide " secondary no-navbar >
58
+ < ion-tab tabTitle ="Recents " tabIcon ="call " [root] ="root " tabBadge ="7 " tabBadgeStyle ="light "> </ ion-tab >
59
+ < ion-tab tabTitle ="Favorites " tabIcon ="heart " [root] ="root "> </ ion-tab >
60
+ < ion-tab tabTitle ="Settings " tabIcon ="settings " [root] ="root "> </ ion-tab >
61
+ </ ion-tabs >
62
+
48
63
<!-- Dynamic Badge -->
49
64
< ion-tabs tabbarLayout ="icon-left " no-navbar >
50
65
< ion-tab tabTitle ="Recents " tabIcon ="call "> </ ion-tab >
Original file line number Diff line number Diff line change 56
56
57
57
58
58
<!-- No title -->
59
- < ion-tabs tabbarLayout ="title-hide " no-navbar secondary >
59
+ < ion-tabs tabbarLayout ="title-hide " secondary no-navbar >
60
60
< ion-tab tabTitle ="Recents " tabIcon ="call " [root] ="root "> </ ion-tab >
61
61
< ion-tab tabTitle ="Favorites " tabIcon ="heart " [root] ="root "> </ ion-tab >
62
62
< ion-tab tabTitle ="Settings " tabIcon ="settings " [root] ="root "> </ ion-tab >
You can’t perform that action at this time.
0 commit comments