-
Notifications
You must be signed in to change notification settings - Fork 0
/
use-case.js
52 lines (42 loc) · 1.26 KB
/
use-case.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* * Start new tab navigation area instance
*/
const customTabNav = new TabNavigation();
/**
* * Configure listeners for TAB navigation events
* * You have to call addEventListener, BEFORE the call to dispatchEvent
*/
customTabNav.addEventListener('tabChange:start', (event) => {
console.log('Fires before the new tab is activated');
});
customTabNav.addEventListener('tabChange:end', (event) => {
console.log('Fires after new tab is activated');
});
customTabNav.addEventListener('tabLoad:start', (event) => {
console.log('Fires when tab loading starts');
if (event.data.id === 'tabExample_02') {
const tab = event.data;
console.dir(tab);
setTimeout(() => {
console.dir(tab);
customTabNav.hideLoading(tab);
}, 10000);
}
if (event.data.id === 'tabExample_04') {
const tab = event.data;
console.dir(tab);
setTimeout(() => {
customTabNav.hideLoading(tab);
}, 5000);
}
});
customTabNav.addEventListener('tabLoad:end', (event) => {
console.log('Fires when tab loading ends');
});
/**
* * Send parameters for new TAB navigation and Start it
*/
customTabNav.init({
containerSelector: '#myCustomTabNav',
startTabId: 'tabExample_05',
});