diff options
| author | 2018-06-02 14:45:11 +0100 | |
|---|---|---|
| committer | 2018-06-02 14:45:11 +0100 | |
| commit | 7cfd6a72491a300f4f599d2b531e9f1dc215c7a0 (patch) | |
| tree | 876d6e9236c38fd4407a6a86a534feb55a33be65 /static/js | |
| parent | [Wiki] Fix UX bug relating to current article headers (diff) | |
[Wiki] Attempt to fix page views on mobile
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/wiki.js | 15 | 
1 files changed, 15 insertions, 0 deletions
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) +        } +    } +}());  |