Created
November 1, 2019 17:04
-
-
Save mrshawnspencer/7e4406cdb700301b74dda9a82206771a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
There are probably more efficient ways of doing this, but this works: | |
1. The li click event sets activeTab to true or false: | |
(click)="activeTab = tab; false;" | |
2. Based on that, we can set the class accordingly: | |
[ngClass]="{'active-tab': tab === activeTab, 'inactive-tab': tab !== activeTab}" | |
*/ | |
<ul id="tab-list" class="tab-list contain" *ngIf="!isEditing"> | |
<li id="tab-button" class="tab-button" (click)="activeTab = tab; false;" *ngFor="let tab of tabs" (mouseover)="tabHover=true" (mouseout)="tabHover=false" [ngClass]="{'active-tab': tab === activeTab, 'inactive-tab': tab !== activeTab}"> | |
<a [ngClass]="{'tab-link': true, 'active': tab === activeTab }" href="#" shleavesiteexception=true> | |
<div id="tab-title" class="tab-title" *scText="tab.fields.data.datasource.tabTitle.jss"></div> | |
<div class="tab-highlight" [class.highlight]="(activeTab === tab)&&(tabHover!=true)"></div> | |
</a> | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment