2019-01-25 16:45:11 -05:00
|
|
|
/**
|
2020-02-25 10:12:28 -05:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2019-01-25 16:45:11 -05:00
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
|
*/
|
2019-01-24 00:48:01 -05:00
|
|
|
// Turn off ESLint for this file because it's sent down to users as-is.
|
2019-11-28 14:44:11 -05:00
|
|
|
|
2019-01-24 00:48:01 -05:00
|
|
|
/* eslint-disable */
|
2020-04-05 10:38:12 -04:00
|
|
|
window.addEventListener('load', function () {
|
2019-01-24 00:48:01 -05:00
|
|
|
// add event listener for all tab
|
2020-04-05 10:38:12 -04:00
|
|
|
document.querySelectorAll('.nav-link').forEach(function (el) {
|
|
|
|
|
el.addEventListener('click', function (e) {
|
2019-11-28 14:44:11 -05:00
|
|
|
var groupId = e.target.getAttribute('data-group');
|
2019-01-24 00:48:01 -05:00
|
|
|
document
|
2019-11-28 14:44:11 -05:00
|
|
|
.querySelectorAll('.nav-link[data-group='.concat(groupId, ']'))
|
2020-04-05 10:38:12 -04:00
|
|
|
.forEach(function (el) {
|
2019-01-24 00:48:01 -05:00
|
|
|
el.classList.remove('active');
|
|
|
|
|
});
|
|
|
|
|
document
|
2019-11-28 14:44:11 -05:00
|
|
|
.querySelectorAll('.tab-pane[data-group='.concat(groupId, ']'))
|
2020-04-05 10:38:12 -04:00
|
|
|
.forEach(function (el) {
|
2019-01-24 00:48:01 -05:00
|
|
|
el.classList.remove('active');
|
|
|
|
|
});
|
|
|
|
|
e.target.classList.add('active');
|
|
|
|
|
document
|
2019-11-28 14:44:11 -05:00
|
|
|
.querySelector('#'.concat(e.target.getAttribute('data-tab')))
|
2019-01-24 00:48:01 -05:00
|
|
|
.classList.add('active');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|