script.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. let table = document.querySelector('.orders_table');
  2. let footings = document.querySelectorAll('.footing');
  3. let headings = document.querySelector('.heading')
  4. let backBtn = document.querySelector('.back');
  5. let divOrder = document.querySelector('div.order');
  6. let scroller = document.querySelector('.scrollmenu');
  7. let scrollersquare = document.querySelector('.scrollersquare');
  8. table.addEventListener('click', function(e) {
  9. let target = e.target;
  10. if (target.classList.contains('heading') || target.parentElement.classList.contains('heading') || target == table) {
  11. return;
  12. }
  13. let order = target.closest('.order');
  14. let footing = order.querySelector('.footing');
  15. footing.style.display = 'flex';
  16. backBtn.classList.remove('disabled');
  17. });
  18. backBtn.addEventListener('click', function() {
  19. if (backBtn.classList.contains('disabled')) {
  20. return;
  21. } else {
  22. footings.forEach(function(footing) {
  23. footing.style.display = 'none';
  24. backBtn.classList.add('disabled');
  25. });
  26. }
  27. });
  28. table.onmouseover = function() {
  29. headings.style.borderColor = 'white';
  30. };
  31. table.onmouseout = function() {
  32. headings.style.border = '';
  33. };
  34. // scroller.addEventListener('scroll', function() {
  35. // scrollersquare.style.display = 'block';
  36. // });