patch: New right menu on mobile - clean up

This commit is contained in:
gaelle morin 2021-04-15 09:00:21 +02:00 committed by Jean-Baptiste Pasquier
parent 5084e21d1f
commit 2c048943a6

View File

@ -66,58 +66,18 @@ contentControls.forEach(
if (contentButton.classList.contains('icon-close')) { if (contentButton.classList.contains('icon-close')) {
contentButton.classList.remove('icon-close'); contentButton.classList.remove('icon-close');
contentButton.classList.add('icon-options-vertical'); contentButton.classList.add('icon-options-vertical');
totosidebar.setAttribute('hidden', ''); contentSidebar.setAttribute('hidden', '');
} }
else { else {
contentButton.classList.remove('icon-options-vertical'); contentButton.classList.remove('icon-options-vertical');
contentButton.classList.add('icon-close'); contentButton.classList.add('icon-close');
totosidebar.removeAttribute('hidden'); contentSidebar.removeAttribute('hidden');
}; };
}) })
) )
} }
); );
/*Array.from(controls).forEach(control => {
const button = control.querySelector('.jsMobileRightMenuButton');
const rightMenu = control.querySelector('.jsRightMenu');
button.addEventListener("click", () => {
if (button.classList.contains('icon-close')) {
button.classList.remove('icon-close');
button.classList.add('icon-options-vertical');
console.log(rightMenu);
rightMenu.setAttribute('hidden', '');
}
else {
button.classList.remove('icon-options-vertical');
button.classList.add('icon-close');
rightMenu.removeAttribute('hidden');
}
});
});*/
/*const buttons = document.querySelectorAll(".jsMobileToggleRightMenu");
Array.from(buttons).forEach(el => el.addEventListener("click", () => {
if (el.classList.contains('icon-close')) {
el.classList.remove('icon-close');
el.classList.add('icon-options-vertical');
const rightMenu = document.querySelectorAll(".jsRightMenu");
rightMenu.classList.add("block");
}
else {
el.classList.remove('icon-options-vertical');
el.classList.add('icon-close');
const rightMenu = document.querySelectorAll(".jsRightMenu");
rightMenu.classList.add("sm-hidden");
};
}));*/
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const componentSet = new Set(window.hubl.components.map(c => c.type)); const componentSet = new Set(window.hubl.components.map(c => c.type));