Commits

Vlad Riscutia  committed 7470b0d

Sidebar size adjust fix

  • Participants
  • Parent commits 5fa89b3
  • Branches html5

Comments (0)

Files changed (2)

File tinkerer/themes/modern5/layout.html

 
     {# Adjusts document height if sidebar is taller #}
     <script type="text/javascript">
-        function adjust() {
+        $(document).ready(function () {
             var content = document.getElementsByClassName("content")[0];
             var sidebar = document.getElementsByClassName("sidebar")[0];
 
-            if (sidebar.offsetHeight < content.offsetHeight)
+            if (sidebar.offsetHeight > content.offsetHeight)
             {
-                sidebar.style.minHeight = content.offsetHeight + "px";
+                content.style.minHeight = sidebar.offsetHeight + "px";
             }
-        }
-        
-        $(document).ready(adjust);
-        $(window).resize(adjust);
+        });
     </script>
 {% endblock %}

File tinkerer/themes/modern5/static/modern5.css_t

 div.section a h1 { color: {{ text_color }}; text-decoration: none; }
 tt.docutils.literal { background-color: {{ sidebar_color }}; }
 
-div.content { background: {{ paper_color }} url('paper.png') repeat; color: {{ text_color }}; }
-aside.sidebar { background-color: {{ sidebar_color }}; }
+div.content { background-color: {{ sidebar_color }}; }
+div.documentwrapper { background: {{ paper_color }} url('paper.png') repeat; }
 
 div.postmeta { color: {{ theme_color_light }}; }
 div.post_separator { border-bottom: 1px dotted {{ theme_color_light }}; }
         box-shadow:         5px 5px 10px 0 #011019; 
     }
 
-    div.documentwrapper { border-left: 1px solid #cfd5da; }
-    aside.sidebar { border-left: 1px solid #cfd5da; border-right: 1px solid #cfd5da; }
+    div.documentwrapper { border-left: 1px solid #cfd5da; border-right: 1px solid #cfd5da; }
+    div.content { border-right: 1px solid #cfd5da; }
 }