From 7cfd6a72491a300f4f599d2b531e9f1dc215c7a0 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Sat, 2 Jun 2018 14:45:11 +0100 Subject: [Wiki] Attempt to fix page views on mobile --- static/js/wiki.js | 15 +++++++++++++++ static/style.css | 20 ++++++++++++++++++++ templates/wiki/base.html | 6 +++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 static/js/wiki.js diff --git a/static/js/wiki.js b/static/js/wiki.js new file mode 100644 index 00000000..6ef4efa9 --- /dev/null +++ b/static/js/wiki.js @@ -0,0 +1,15 @@ +"use strict"; + +(function(){ // Use a closure to avoid polluting global scope + const visible_class = "uk-visible@s"; + const sidebar = document.getElementById("wiki-sidebar"); + const display_button = document.getElementById("wiki-sidebar-button"); + + display_button.onclick = function() { + if (sidebar.classList.contains(visible_class)) { + sidebar.classList.remove(visible_class) + } else { + sidebar.classList.add(visible_class) + } + } +}()); diff --git a/static/style.css b/static/style.css index b404ced3..b76b2e57 100644 --- a/static/style.css +++ b/static/style.css @@ -226,4 +226,24 @@ td.right-border, th.right-border { textarea.fira-code { line-height: 1.3 !important; +} + +#wiki-sidebar { + transition: width ease 1s; +} + +#wiki-sidebar-button { + color: white; + height: 3rem; + width: 3rem; + min-height: 3rem; + min-width: 3rem; + align-items: center; + justify-content: center; + /*box-shadow: unset; */ + border: 1px solid rgba(0, 0, 0, 0.11); +} + +.code{ + overflow-x: scroll; } \ No newline at end of file diff --git a/templates/wiki/base.html b/templates/wiki/base.html index 126ab4a3..9fe4b4e9 100644 --- a/templates/wiki/base.html +++ b/templates/wiki/base.html @@ -31,7 +31,7 @@
{% include "main/navigation.html" %}
-
+
    {% if data is defined and current_page == "wiki.page" %} {% if "headers" in data and data.headers %} @@ -188,6 +188,9 @@
+ +
+
{% block content %}{% endblock %}
@@ -209,5 +212,6 @@ + -- cgit v1.2.3