Parcourir la source

Remove nav elevator on small devices

Maxime Vidori il y a 9 ans
Parent
commit
b9bb924fb1
2 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 5 0
      theme/static/scripts/mine.js
  2. 2 4
      theme/templates/base.html

+ 5 - 0
theme/static/scripts/mine.js

@@ -8,6 +8,11 @@ $window.on('load', function() {
   var content = $('#content');
   var size = 24; // magic number !
 
+  // nav is not displayed on small screens so no need to continue
+  if (window.matchMedia('(max-width: 40rem)').matches) {
+    return;
+  }
+
   content.find('h2:last').add('h2:last ~ *').each(function() {
     size += $(this).outerHeight(true);
   });

+ 2 - 4
theme/templates/base.html

@@ -57,10 +57,8 @@
     {% block content %}
     {% endblock %}
     </div>
-    <footer id="contentinfo" class="body">
-
-    <a href="#">Mentions légales</a>
-
+    <footer id="contentinfo">
+      <a href="#">Mentions légales</a>
     </footer>
 
     {% include 'analytics.html' %}