Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

Commit

Permalink
fix: navigation ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin committed Feb 4, 2017
1 parent d0bffc9 commit eb2e25a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.styl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ md-spinner.in-button-spinner
* Fake tabs
*/

.tabs button
.tabs a
-webkit-flex: 1
flex: 1
padding-bottom: 10px
Expand Down
21 changes: 12 additions & 9 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
<md-toolbar color="primary" class="tabs">
<button
<a
md-button
(click)="navigate('meditation')"
(tap)="navigate('meditation')"
[class.highlight]="currentTab === 'meditation'"
[routerLink]="['/home', { tab: 'meditation' }]"
>
MEDITATION
</button>
<button
</a>
<a
md-button
[class.highlight]="currentTab === 'chat'"
[routerLink]="['/home', { tab: 'chat' }]"
(click)="navigate('chat')"
(tap)="navigate('chat')"
>
CHAT
</button>
<button
</a>
<a
md-button
[class.highlight]="currentTab === 'ask'"
[routerLink]="['/home', { tab: 'ask' }]"
(click)="navigate('ask')"
(tap)="navigate('ask')"
>
ASK
</button>
</a>
</md-toolbar>

<meditation
Expand Down
3 changes: 3 additions & 0 deletions src/app/home/home.component.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
meditation.hidden, question.hidden, message.hidden
display: none !important

.tabs .highlight /deep/ .md-button-focus-overlay
opacity: 1

.component-separator
margin-top: 10px

Expand Down
4 changes: 4 additions & 0 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export class HomeComponent {
});
}

navigate(tab: string) {
this.router.navigate(['home', {tab}]);
}

getButtonColor(tab: string) {
return this.currentTab === tab ? 'primary' : '';
}
Expand Down

0 comments on commit eb2e25a

Please sign in to comment.