diff --git a/README.md b/README.md index e10df9d..fec6d46 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# readme placeholder +# readme ended up here? this is a wip version of the enhancer, and this file is yet to be completed. if you're interested in using the project, switch back to the [master branch](https://github.com/dragonwocky/notion-enhancer). diff --git a/mods/core/dragarea.js b/mods/core/dragarea.js index 1720035..b204f4b 100644 --- a/mods/core/dragarea.js +++ b/mods/core/dragarea.js @@ -22,9 +22,8 @@ module.exports = (defaults) => if (event.channel.startsWith('enhancer:sidebar-width-')) dragarea.setAttribute( 'style', - `${default_styles} left: height: ${ - settings.dragarea_height - }px; ${event.channel.slice('enhancer:sidebar-width-'.length)};` + `${default_styles} height: ${settings.dragarea_height}px; left: ${ + event.channel.slice('enhancer:sidebar-width-'.length)};` ); }); }; diff --git a/mods/core/titlebar.js b/mods/core/titlebar.js index 44fcb6e..4c26ca1 100644 --- a/mods/core/titlebar.js +++ b/mods/core/titlebar.js @@ -33,8 +33,7 @@ module.exports = (defaults) => document.body.classList.add('frameless'); // draggable area - const dragarea = document.createElement('div'), - sidebar = document.querySelector('.notion-sidebar'); + const dragarea = document.createElement('div'); dragarea.className = 'window-dragarea'; document.querySelector('.notion-topbar').prepend(dragarea); document.documentElement.style.setProperty( @@ -43,8 +42,9 @@ module.exports = (defaults) => ); let sidebar_width; setInterval(() => { + const sidebar = document.querySelector('.notion-sidebar'); let new_width = - sidebar.style.opacity === '0' ? '0px' : sidebar.style.width; + sidebar.style.height === 'auto' ? '0px' : sidebar.style.width; if (sidebar_width !== new_width) { sidebar_width = new_width; electron.ipcRenderer.sendToHost( @@ -124,6 +124,12 @@ module.exports = (defaults) => btn ]()}`; } + if (settings.frameless && !is_mac) + setInterval(async () => { + const icon = await buttons.icons.maximize(), + el = buttons.element.querySelector('.btn-maximize'); + if (el.innerHTML != icon) el.innerHTML = icon; + }, 100); document .querySelector('.notion-topbar > div[style*="display: flex"]') @@ -141,12 +147,5 @@ module.exports = (defaults) => document.querySelector(`.window-button.btn-${btn}`).onclick = buttons.actions[btn]; } - - // if (!isMac) { - // setInterval(() => { - // if (button_elements.maximize.innerHTML != buttons.icons.maximize()) - // button_elements.maximize.innerHTML = buttons.icons.maximize(); - // }, 1000); - // } } };