Commit c656a872 authored by Kenton Varda's avatar Kenton Varda Committed by Kenton Varda

In mobile view, put the sidebar at the bottom, not the top. Duh.

parent 92372663
<div style="clear: both;"></div> <div style="clear: both;"></div>
</section> </section>
<section id="menu">
<ul>
<li><a href="{{ site.baseurl }}index.html">Introduction</a></li>
<li><a href="{{ site.baseurl }}news/">News</a></li>
<li><a href="{{ site.baseurl }}install.html">Installation</a></li>
<li><a href="{{ site.baseurl }}language.html">Schema Language</a></li>
<li><a href="{{ site.baseurl }}encoding.html">Encoding</a></li>
<li><a href="{{ site.baseurl }}rpc.html">RPC Protocol</a></li>
<li><a href="{{ site.baseurl }}capnp-tool.html">The <code>capnp</code> Tool</a></li>
<li><a href="{{ site.baseurl }}cxx.html">C++ Serialization</a></li>
<li><a href="{{ site.baseurl }}cxxrpc.html">C++ RPC</a></li>
<li><a href="{{ site.baseurl }}otherlang.html">Other Languages</a></li>
<li><a href="{{ site.baseurl }}roadmap.html">Road Map</a></li>
<li><a href="{{ site.baseurl }}faq.html">FAQ</a></li>
</ul>
</section>
<script type="text/javascript">setupSidebar()</script>
</div> </div>
<!-- FOOTER --> <!-- FOOTER -->
......
...@@ -40,20 +40,4 @@ ...@@ -40,20 +40,4 @@
<!-- MAIN CONTENT --> <!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer"> <div id="main_content_wrap" class="outer">
<section id="menu">
<ul>
<li><a href="{{ site.baseurl }}index.html">Introduction</a></li>
<li><a href="{{ site.baseurl }}news/">News</a></li>
<li><a href="{{ site.baseurl }}install.html">Installation</a></li>
<li><a href="{{ site.baseurl }}language.html">Schema Language</a></li>
<li><a href="{{ site.baseurl }}encoding.html">Encoding</a></li>
<li><a href="{{ site.baseurl }}rpc.html">RPC Protocol</a></li>
<li><a href="{{ site.baseurl }}capnp-tool.html">The <code>capnp</code> Tool</a></li>
<li><a href="{{ site.baseurl }}cxx.html">C++ Serialization</a></li>
<li><a href="{{ site.baseurl }}cxxrpc.html">C++ RPC</a></li>
<li><a href="{{ site.baseurl }}otherlang.html">Other Languages</a></li>
<li><a href="{{ site.baseurl }}roadmap.html">Road Map</a></li>
<li><a href="{{ site.baseurl }}faq.html">FAQ</a></li>
</ul>
</section>
<section id="main_content" class="inner"> <section id="main_content" class="inner">
{% include header.html %} {% include header.html %}
{{ content }} {{ content }}
<script type="text/javascript">setupSidebar()</script>
{% include footer.html %} {% include footer.html %}
...@@ -11,9 +11,9 @@ href="https://groups.google.com/group/capnproto-announce">Get Email Updates</a> ...@@ -11,9 +11,9 @@ href="https://groups.google.com/group/capnproto-announce">Get Email Updates</a>
on <span class="date">{{ page.date | date_to_string }}</span> on <span class="date">{{ page.date | date_to_string }}</span>
</p> </p>
{{ content }} {{ content }}
<script type="text/javascript">setupNewsSidebar([ <script type="text/javascript">var CAPNP_NEWS_SIDEBAR = [
{% for post in site.posts %} {% for post in site.posts %}
{ title: "{{ post.title }}", url: "{{ site.baseurl }}.{{ post.url }}" }, { title: "{{ post.title }}", url: "{{ site.baseurl }}.{{ post.url }}" },
{% endfor %} {% endfor %}
]);</script> ];</script>
{% include footer.html %} {% include footer.html %}
...@@ -16,6 +16,7 @@ function initSidebar() { ...@@ -16,6 +16,7 @@ function initSidebar() {
if (window.innerWidth < 900) { if (window.innerWidth < 900) {
document.body.className = "narrow"; document.body.className = "narrow";
menu.className = ""; menu.className = "";
document.getElementById("main_content").style.minHeight = "0";
} else { } else {
if (document.body.clientWidth < 1340) { if (document.body.clientWidth < 1340) {
document.body.className = "normal"; document.body.className = "normal";
...@@ -31,6 +32,10 @@ function initSidebar() { ...@@ -31,6 +32,10 @@ function initSidebar() {
} else { } else {
menu.className = "floating"; menu.className = "floating";
} }
setTimeout(function () {
document.getElementById("main_content").style.minHeight = menu.clientHeight + 100 + "px";
}, 10);
} }
}; };
setMenuLayout(); setMenuLayout();
...@@ -58,12 +63,15 @@ function initSidebar() { ...@@ -58,12 +63,15 @@ function initSidebar() {
} }
} }
document.getElementById("main_content").style.minHeight = menu.clientHeight + 100 + "px";
return toc; return toc;
} }
function setupSidebar() { function setupSidebar() {
if (window.CAPNP_NEWS_SIDEBAR) {
setupNewsSidebar(CAPNP_NEWS_SIDEBAR);
return;
}
var filename = document.location.pathname; var filename = document.location.pathname;
if (filename.slice(0, 5) == "/next") { if (filename.slice(0, 5) == "/next") {
......
...@@ -20,5 +20,4 @@ href="https://groups.google.com/group/capnproto-announce">Get Email Updates</a> ...@@ -20,5 +20,4 @@ href="https://groups.google.com/group/capnproto-announce">Get Email Updates</a>
{{ post.content }} {{ post.content }}
{% endfor %} {% endfor %}
<script type="text/javascript">setupSidebar()</script>
{% include footer.html %} {% include footer.html %}
...@@ -596,7 +596,7 @@ body.narrow #menu { ...@@ -596,7 +596,7 @@ body.narrow #menu {
position: relative; position: relative;
max-width: 640px; max-width: 640px;
padding: 50px 10px 0px 10px; padding: 50px 10px 0px 10px;
margin: 0 auto; margin: 0 auto 1em;
} }
@media screen and (max-width: 480px) { @media screen and (max-width: 480px) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment