Skip to content

Commit 8363685

Browse files
Gourav DwivediGourav Dwivedi
authored andcommitted
fixed tabname change bug
1 parent 4e1a3ad commit 8363685

File tree

5 files changed

+11
-94
lines changed

5 files changed

+11
-94
lines changed

src/js/components/app.component.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ class AppComponent extends HTMLElement {
2323
<div class="panel panel-primary">
2424
<ul class="nav nav-tabs justify-content-end nav-justified" id="tabheader">
2525
<li class="nav-item">
26-
<a class="nav-link active" data-tab-type="basic" data-toggle="tab" href="#basicview">Basic</a>
26+
<a class="nav-link active" data-tab-type="basic" data-toggle="tab" href="#appview">Basic</a>
2727
</li>
2828
<li class="nav-item">
29-
<a class="nav-link" data-tab-type="advance" data-toggle="tab" href="#basicview">Advance</a>
29+
<a class="nav-link" data-tab-type="advance" data-toggle="tab" href="#appview">Advance</a>
3030
</li>
3131
</ul>
3232
3333
<div class="tab-content container clearfix tabcontent">
34-
<div id="basicview" class="tab-pane active">
35-
<h2>Basic</h2>
34+
<div id="appview" class="tab-pane active">
35+
<h4>Basic</h4>
3636
<sr-form></sr-form>
3737
</div>
3838
</div>

src/js/components/custom.alertbox.html

Whitespace-only changes.

src/js/components/custom.alertbox.js

Lines changed: 0 additions & 86 deletions
This file was deleted.

src/js/components/srform.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as Test from '../components/dialogbox/custompopup';
66
var isConnected = false;
77
//#region ConnectedEvent
88
AppCommon.AppEvents.on('Init', () => {
9-
//console.log('Init Event Emitter');
9+
1010
});
1111
//#endregion
1212

@@ -20,7 +20,6 @@ AppCommon.AppEvents.on('OnDisconnected', () => {
2020
//#endregion
2121

2222
export function Init() {
23-
debugger;
2423
window.appLogic = new AppLogic();
2524
//Connect Button Events
2625
document.getElementById('btn-connect')
@@ -99,21 +98,25 @@ export function RigisterNavigationTabEvent() {
9998
for (var i = 0; i < navLinkClass.length; i++) {
10099
navLinkClass[i].addEventListener('click',
101100
function () {
102-
console.log(this.getAttribute('data-tab-type'));
103101
OnTabChange(this.getAttribute('data-tab-type'));
104102
},
105103
false);
106104
}
107105
}
108106

109107
export function OnTabChange(tabName) {
108+
var appView = document.getElementById('appview');
109+
var tabHeaderElement = appView.getElementsByTagName('h4')[0];
110+
110111
if (tabName == 'basic') {
111112
window.appLogic.SetCurrentViewAsBasic();
112113
AdvanceViewElements(false);
114+
tabHeaderElement.innerText = "Basic";
113115
}
114116
else {
115117
window.appLogic.SetCurrentViewAsAdvance();
116118
AdvanceViewElements(true);
119+
tabHeaderElement.innerText = "Advance";
117120
}
118121
}
119122

src/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'material-design-lite/dist/material.indigo-blue.min.css'
44
import 'material-design-lite/material.min.js'
55
import 'bootstrap/dist/js/bootstrap.js'
66
import '../css/main.css';
7-
import './components/custom.alertbox';
7+
// import './components/custom.alertbox';
88
import './components/srform.component';
99
import './components/app.component';
1010

0 commit comments

Comments
 (0)