list.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <div class="mid">
  2. <div class="divider">
  3. <nav id="list-menu" class="l" data-dir="{{ $.context.Param "languagedir" | default "ltr" }}">
  4. {{ if $.context.Param "enableMenu" }}
  5. {{ partial "main/sections/list-menu.html" .context }}
  6. {{ end }}
  7. </nav>
  8. <article id="list-main" class="m" data-dir="{{ $.context.Param "languagedir" | default "ltr" }}">
  9. {{ partial "main/sections/list-main.html" .context }}
  10. {{ if .section_to_display }}
  11. {{ partial "main/sections/list-section.html" (dict "section_to_display" .section_to_display) }}
  12. {{ end }}
  13. {{ partial "main/component/pagination-single.html" .context }}
  14. </article>
  15. <section id="list-side" class="r" data-dir="{{ $.context.Param "languagedir" | default "ltr" }}">
  16. </section>
  17. </div>
  18. </div>
  19. <script>
  20. var listSide = document.getElementById('list-side');
  21. var listMain = document.getElementById('list-main');
  22. var listMenu = document.getElementById('list-menu');
  23. var switchElem = document.querySelector('.switch');
  24. enquire.register("screen and (max-width:1280px)", {
  25. match: function () {
  26. listSide.className = 'r';
  27. listMain.className = 'm';
  28. listMenu.className = 'l';
  29. },
  30. unmatch: function () {
  31. listSide.className = 'r';
  32. listMain.className = 'm';
  33. listMenu.className = 'l';
  34. },
  35. }).register("screen and (max-width:960px)", {
  36. match: function () {
  37. listSide.className = 'hide';
  38. listMain.className = 'mr';
  39. listMenu.className = 'l';
  40. switchElem.className = 'hide';
  41. },
  42. unmatch: function () {
  43. listSide.className = 'r';
  44. listMain.className = 'm';
  45. listMenu.className = 'l';
  46. switchElem.className = 'switch';
  47. },
  48. }).register("screen and (max-width:600px)", {
  49. match: function () {
  50. listSide.className = 'hide';
  51. listMain.className = 'lmr';
  52. listMenu.className = 'hide';
  53. switchElem.className = 'hide';
  54. },
  55. unmatch: function () {
  56. listSide.className = 'hide';
  57. listMain.className = 'mr';
  58. listMenu.className = 'l';
  59. switchElem.className = 'hide';
  60. },
  61. });
  62. </script>