templates/includes/common/web-harmony.html.twig line 1

Open in your IDE?
  1. <link rel="stylesheet" href="{{ web_harmony_css_url }}" />
  2. <script src="{{ web_harmony_js_url }}"></script>
  3. <web-harmony
  4. locale="{{ app.request.locale }}"
  5. {%- if footer_positioning_mobile is defined and footer_positioning_mobile is not empty %} footer-positioning-mobile="{{ footer_positioning_mobile }}"{% endif %}
  6. {%- if footer_positioning_desktop is defined and footer_positioning_desktop is not empty %} footer-positioning-desktop="{{ footer_positioning_desktop }}"{% endif %}
  7. ></web-harmony>
  8. <script>window.WebHarmony.init();</script>
  9. <script>
  10. (function () {
  11. document.body.addEventListener('wh:locale:change', function (event) {
  12. var detail = event.detail;
  13. var newLocale = typeof detail === 'string'
  14. ? detail
  15. : (detail && (detail.locale || detail.lang || detail.code)) || '';
  16. if (!newLocale) {
  17. return;
  18. }
  19. var pathname = window.location.pathname;
  20. var segments = pathname.split('/');
  21. if (segments.length > 1 && segments[1]) {
  22. if (segments[1] === newLocale) {
  23. return;
  24. }
  25. segments[1] = newLocale;
  26. } else {
  27. segments = ['', newLocale];
  28. }
  29. window.location.assign(segments.join('/') + window.location.search + window.location.hash);
  30. });
  31. })();
  32. </script>
  33. <script>
  34. (function () {
  35. var FALLBACK_HEIGHT = 80;
  36. var root = document.documentElement;
  37. function setHeight(value) {
  38. root.style.setProperty('--web-harmony-footer-height', value + 'px');
  39. }
  40. setHeight(FALLBACK_HEIGHT);
  41. function observeFooter(footer) {
  42. var update = function () {
  43. var rect = footer.getBoundingClientRect();
  44. setHeight(Math.ceil(rect.height) || FALLBACK_HEIGHT);
  45. };
  46. update();
  47. if (typeof ResizeObserver === 'function') {
  48. new ResizeObserver(update).observe(footer);
  49. }
  50. window.addEventListener('resize', update);
  51. }
  52. function findAndObserveFooter() {
  53. var footer = document.querySelector('web-harmony footer.TheFooter');
  54. if (footer) {
  55. observeFooter(footer);
  56. return true;
  57. }
  58. return false;
  59. }
  60. if (!findAndObserveFooter()) {
  61. var observer = new MutationObserver(function () {
  62. if (findAndObserveFooter()) observer.disconnect();
  63. });
  64. observer.observe(document.body, { childList: true, subtree: true });
  65. }
  66. })();
  67. </script>
  68. <style>
  69. #body {
  70. display: flex;
  71. flex-direction: column;
  72. }
  73. web-harmony {
  74. display: block;
  75. order: 99;
  76. }
  77. @media (min-width: 960px) {
  78. #body {
  79. padding-left: 80px;
  80. }
  81. }
  82. @media (min-width: 992px) {
  83. .is-Map {
  84. left: 50px;
  85. }
  86. #is-Features {
  87. top: 28px;
  88. left: 110px;
  89. }
  90. }
  91. .is-Button_Search { color: #fff!important; }
  92. </style>