NikolayBezay

Soda new top bar design AB testing.

Jan 18th, 2022 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. <script>
  2. /*Soda DT update position*/
  3. (function() {
  4. function moveNativeContent() {
  5. var currentCanvas = document.querySelector('.' + self.identifier + ' [tabindex]');
  6. if (!currentCanvas) return;
  7. var newBar = document.querySelector('#header-v2.d-block .header-v2-container.header-desktop');
  8. if (newBar) {
  9. newBar.style.marginTop = '';
  10. }
  11. var additionlMenu = document.querySelector('.duo-menu');
  12. if (additionlMenu) {
  13. additionlMenu.style.top = '16.4rem';
  14. }
  15. }
  16. if (document.readyState === 'loading') {
  17. document.addEventListener('DOMContentLoaded', function() {
  18. moveNativeContent();
  19. setTimeout(moveNativeContent, 250);
  20. });
  21. } else {
  22. moveNativeContent();
  23. setTimeout(moveNativeContent, 250);
  24. }
  25. })();
  26. </script>
  27.  
  28. <script>
  29. /*Soda MOB update position*/
  30. (function() {
  31. function moveNativeContent() {
  32. var currentCanvas = document.querySelector('.' + self.identifier + ' [tabindex]');
  33. if (!currentCanvas) return;
  34. var newBar = document.querySelector('#header-v2.d-block .header-v2-container.header-mobile');
  35. var nativeDropDown = document.querySelectorAll('.menu-dropdown-container');
  36. var nativeMobileNavigation = document.querySelector('.header-mobile-navigation');
  37. if (newBar && nativeDropDown && nativeMobileNavigation) {
  38. newBar.style.marginTop = '';
  39. nativeMobileNavigation.style.marginTop = '';
  40. for (var i = 0; i < nativeDropDown.length; i++) {
  41. nativeDropDown[i].style.marginTop = '';
  42. }
  43. }
  44. var additionlMenu = document.querySelector('.duo-menu');
  45. if (additionlMenu) {
  46. additionlMenu.style.top = '12.3rem';
  47. }
  48. }
  49. if (document.readyState === 'loading') {
  50. document.addEventListener('DOMContentLoaded', function() {
  51. moveNativeContent();
  52. setTimeout(moveNativeContent, 500);
  53. });
  54. } else {
  55. moveNativeContent();
  56. setTimeout(moveNativeContent, 500);
  57. }
  58. })();
  59. </script>
  60.  
Add Comment
Please, Sign In to add comment