Skip to content

Commit

Permalink
fix: accidentally removed body scroll, *actually* fix layout jump
Browse files Browse the repository at this point in the history
  • Loading branch information
not-nullptr committed Jul 12, 2024
1 parent d2867e9 commit 16c74f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion layouts/header/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ input, textarea {
height: 46px;
top: 0;
left: 0;
width: 100%;
width: 100vw;
z-index: 100;
font-size: 13px;
color: var(--darker-gray);
padding-right: calc(100vw - 100%);
}

#navbar-line {
Expand Down
5 changes: 1 addition & 4 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function createModal(html, className, onclose, canclose) {
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
document.body.style.transform = `translateX(${scrollbarWidth}px)`;
let modal = document.createElement('div');
modal.classList.add('modal');
let modal_content = document.createElement('div');
Expand All @@ -28,8 +26,8 @@ function createModal(html, className, onclose, canclose) {
close.classList.add('modal-close');
close.title = "ESC";
close.innerHTML = '×';
document.body.style.overflowY = 'hidden';
function removeModal() {
document.body.style.transform = ``;
modal.remove();
let event = new Event('findActiveTweet');
document.dispatchEvent(event);
Expand Down Expand Up @@ -63,7 +61,6 @@ function createModal(html, className, onclose, canclose) {
document.addEventListener('keydown', escapeEvent);
modal_content.appendChild(close);
document.body.appendChild(modal);
document.body.style.transform = ``
return modal;
}
async function handleFiles(files, mediaArray, mediaContainer, is_dm = false) {
Expand Down
1 change: 1 addition & 0 deletions scripts/injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ let page = realPath === "" ? pages[0] : pages.find(p => (!p.exclude || !p.exclud
}

document.documentElement.innerHTML = html;
document.getElementById("fake-react-root").style.paddingLeft = 'calc(100vw - 100%)'
document.body.classList.add('body-old-ui');

blockingObserver.disconnect();
Expand Down

0 comments on commit 16c74f6

Please sign in to comment.