Skip to content

Commit bf03f41

Browse files
author
Di Wang
committed
wizard add tabs
1 parent 2223dc3 commit bf03f41

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/app/dashboard/component/wizard/wizard.component.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ <h5 class="text-center" style="margin-top: 5px">This information will let us kno
1616
<div class="move-tab text-center text-uppercase">About</div>
1717
</div>
1818
<div class="wizard-body">
19-
dsds
19+
<div class="wizard-tab">
20+
tab 1
21+
</div>
22+
<div class="wizard-tab">
23+
tab 2
24+
</div>
25+
<div class="wizard-tab">
26+
tab 3
27+
</div>
2028
</div>
2129
<div class="wizard-footer">
2230
<button id="preBtn" class="btn btn-danger" (click)="preOnClick()">Previous</button>

src/app/dashboard/component/wizard/wizard.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export class WizardComponent implements OnInit, AfterViewInit {
2222
if (screenWidth > 990) {
2323
if (this.tabIndex === 1) {
2424
moveTab.style.left = '20vw';
25-
console.log('111');
2625
} else if (this.tabIndex === 2) {
2726
moveTab.style.left = '41vw';
2827
}
@@ -34,13 +33,21 @@ export class WizardComponent implements OnInit, AfterViewInit {
3433
}
3534
}
3635
});
36+
const tabs = document.getElementsByClassName('wizard-tab');
37+
for (let i = 1; i < tabs.length; i++) {
38+
(<HTMLElement>tabs[i]).style.display = 'none';
39+
}
3740
}
3841

3942
preOnClick() {
4043
const moveTab = <HTMLElement>document.querySelector('.move-tab');
4144
const nextBtn = <HTMLElement>document.getElementById('nextBtn');
4245
const preBtn = <HTMLElement>document.getElementById('preBtn');
46+
const tabs = document.getElementsByClassName('wizard-tab');
4347
const screenWidth = document.body.clientWidth;
48+
for (let i = 0; i < tabs.length; i++) {
49+
(<HTMLElement>tabs[i]).style.display = 'none';
50+
}
4451
if (this.tabIndex === 2) {
4552
this.tabIndex--;
4653
moveTab.style.left = screenWidth > 990 ? '20vw' : '30vw';
@@ -52,13 +59,18 @@ export class WizardComponent implements OnInit, AfterViewInit {
5259
preBtn.style.visibility = 'hidden';
5360
moveTab.innerHTML = 'About';
5461
}
62+
(<HTMLElement>tabs[this.tabIndex]).style.display = 'inherit';
5563
}
5664

5765
nextOnClick() {
5866
const moveTab = <HTMLElement>document.querySelector('.move-tab');
5967
const nextBtn = <HTMLElement>document.getElementById('nextBtn');
6068
const preBtn = <HTMLElement>document.getElementById('preBtn');
69+
const tabs = document.getElementsByClassName('wizard-tab');
6170
const screenWidth = document.body.clientWidth;
71+
for (let i = 0; i < tabs.length; i++) {
72+
(<HTMLElement>tabs[i]).style.display = 'none';
73+
}
6274
if (this.tabIndex === 0) {
6375
this.tabIndex++;
6476
moveTab.style.left = screenWidth > 990 ? '20vw' : '30vw';
@@ -70,6 +82,7 @@ export class WizardComponent implements OnInit, AfterViewInit {
7082
nextBtn.style.visibility = 'hidden';
7183
moveTab.innerHTML = 'Address';
7284
}
85+
(<HTMLElement>tabs[this.tabIndex]).style.display = 'inherit';
7386
}
7487

7588
}

0 commit comments

Comments
 (0)