script.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. footings.forEach(function(footing) {
  10. footing.style.display = 'none';
  11. backBtn.classList.add('disabled');
  12. });
  13. let target = e.target;
  14. if (target.classList.contains('heading') || target.parentElement.classList.contains('heading') || target == table) {
  15. return;
  16. }
  17. let order = target.closest('.order');
  18. let footing = order.querySelector('.footing');
  19. footing.style.display = 'flex';
  20. backBtn.classList.remove('disabled');
  21. });
  22. backBtn.addEventListener('click', function() {
  23. if (backBtn.classList.contains('disabled')) {
  24. return;
  25. } else {
  26. footings.forEach(function(footing) {
  27. footing.style.display = 'none';
  28. backBtn.classList.add('disabled');
  29. });
  30. }
  31. });
  32. table.onmouseover = function() {
  33. headings.style.borderColor = 'white';
  34. };
  35. table.onmouseout = function() {
  36. headings.style.border = '';
  37. };