Browse Source

[matrix] Hide hamburger menu on pages without sidebar

pull/6176/head
Josh 5 years ago
committed by Rapptz
parent
commit
4b82785e10
  1. 22
      docs/_static/custom.js
  2. 2
      docs/_templates/layout.html

22
docs/_static/custom.js

@ -56,16 +56,18 @@ document.addEventListener('DOMContentLoaded', () => {
sections = document.querySelectorAll('section');
hamburgerToggle = document.getElementById('hamburger-toggle');
hamburgerToggle.addEventListener('click', (e) => {
sidebar.element.classList.toggle('sidebar-toggle');
let button = hamburgerToggle.firstElementChild;
if (button.textContent == 'menu') {
button.textContent = 'close';
}
else {
button.textContent = 'menu';
}
});
if (hamburgerToggle) {
hamburgerToggle.addEventListener('click', (e) => {
sidebar.element.classList.toggle('sidebar-toggle');
let button = hamburgerToggle.firstElementChild;
if (button.textContent == 'menu') {
button.textContent = 'close';
}
else {
button.textContent = 'menu';
}
});
}
const tables = document.querySelectorAll('.py-attribute-table[data-move-to-id]');
tables.forEach(table => {

2
docs/_templates/layout.html

@ -102,9 +102,11 @@
</div>
{#- The sidebar component #}
<aside class="grid-item">
{%- if display_toc %}
<span id="hamburger-toggle">
<span class="material-icons">menu</span>
</span>
{%- endif %}
<span id="settings-toggle" class="settings" onclick="settingsModal.open();">
<span class="material-icons">settings</span>
</span>

Loading…
Cancel
Save