Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2017-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. // Turn off ESLint for this file because it's sent down to users as-is.
  8. /* eslint-disable */
  9. window.addEventListener('load', function() {
  10. // add event listener for all tab
  11. document.querySelectorAll('.nav-link').forEach(function(el) {
  12. el.addEventListener('click', function(e) {
  13. var groupId = e.target.getAttribute('data-group');
  14. document
  15. .querySelectorAll('.nav-link[data-group='.concat(groupId, ']'))
  16. .forEach(function(el) {
  17. el.classList.remove('active');
  18. });
  19. document
  20. .querySelectorAll('.tab-pane[data-group='.concat(groupId, ']'))
  21. .forEach(function(el) {
  22. el.classList.remove('active');
  23. });
  24. e.target.classList.add('active');
  25. document
  26. .querySelector('#'.concat(e.target.getAttribute('data-tab')))
  27. .classList.add('active');
  28. });
  29. });
  30. });