diff --git a/src/mami.js/main.js b/src/mami.js/main.js index 118e56e..fe4bf01 100644 --- a/src/mami.js/main.js +++ b/src/mami.js/main.js @@ -303,22 +303,15 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } }; 'click': function() { const sidebar = $c('sidebar')[0]; const toggle = Umi.UI.Toggles.Get('menu-toggle'); - const toggleOpened = 'sidebar__selector-mode--menu-toggle-opened'; - const toggleClosed = 'sidebar__selector-mode--menu-toggle-closed'; - const isClosed = toggle.classList.contains(toggleClosed); + const isClosed = toggle.classList.contains('sidebar__selector-mode--menu-toggle-closed'); if(sidebarAnimation !== null) { sidebarAnimation.cancel(); sidebarAnimation = null; } - if(isClosed) { - toggle.classList.add(toggleOpened); - toggle.classList.remove(toggleClosed); - } else { - toggle.classList.add(toggleClosed); - toggle.classList.remove(toggleOpened); - } + toggle.classList.toggle('sidebar__selector-mode--menu-toggle-opened', isClosed); + toggle.classList.toggle('sidebar__selector-mode--menu-toggle-closed', !isClosed); let update; if(isClosed) @@ -533,7 +526,6 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } }; }); - // really not sure about all the watchers for the protocol just kinda being Listed here but we'll see i guess loadingOverlay.setMessage('Connecting...'); const setLoadingOverlay = async (icon, header, message, optional) => {