Skip to content
Snippets Groups Projects
Commit e6333ec4 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

Revert "Resolve "Forum: Schreiben von Beiträgen kaputt""

This reverts commit 6f56f684.
parent d782b7e1
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import eventBus from '../lib/event-bus.ts';
STUDIP.ready(() => {
// Manually nudge sidebar under main header.
STUDIP.Sidebar.place();
STUDIP.Sidebar.observeBody();
STUDIP.Sidebar.observeFooter();
STUDIP.Sidebar.observeSidebar();
......@@ -10,5 +11,4 @@ STUDIP.ready(() => {
document.defaultView.addEventListener('resize',() => {
STUDIP.Sidebar.reset();
});
});
......@@ -22,7 +22,7 @@ const Sidebar = {
const sidebar = document.getElementById('sidebar');
if (sidebar) {
const sObserver = new IntersectionObserver(STUDIP.Sidebar.fits, options);
sObserver.observe(sidebar, options);
sObserver.observe();
}
},
......@@ -36,11 +36,11 @@ const Sidebar = {
for (const mutation of mutations) {
if ((!mutation.oldValue || mutation.oldValue.indexOf('fixed') === -1)
&& mutation.target.classList.contains('fixed')) {
sidebar.style.top = '';
sidebar.classList.add('fixed');
sidebar.style.top = '';
} else if (mutation.oldValue && mutation.oldValue.indexOf('fixed') !== -1
&& !mutation.target.classList.contains('fixed')) {
STUDIP.Sidebar.reset();
sidebar.classList.remove('fixed');
}
}
});
......@@ -64,18 +64,17 @@ const Sidebar = {
* Observe if the footer is visible in viewport.
*/
const fObserver = new IntersectionObserver(STUDIP.Sidebar.footerVisible, options);
fObserver.observe(document.getElementById('main-footer'), options);
fObserver.observe(document.getElementById('main-footer'));
},
reset() {
const sidebar = document.getElementById('sidebar');
if (sidebar) {
sidebar.classList.remove('oversized', 'was-oversized', 'fixed');
sidebar.classList.remove('oversized', 'adjusted', 'fixed');
sidebar.style.top = '';
STUDIP.Sidebar.place();
STUDIP.Sidebar.observeSidebar();
}
STUDIP.Sidebar.observe();
},
fits(entries, observer) {
......@@ -86,7 +85,7 @@ const Sidebar = {
if (entry.isIntersecting) {
sidebar.classList.remove('oversized');
} else {
sidebar.classList.add('oversized', 'was-oversized');
sidebar.classList.add('oversized', 'adjusted');
}
});
}
......@@ -98,9 +97,13 @@ const Sidebar = {
entries.forEach(entry => {
// Footer is visible on current page.
if (entry.isIntersecting) {
sidebar.classList.remove('no-footer');
if (sidebar.classList.contains('no-footer')) {
sidebar.classList.remove('no-footer');
}
} else {
sidebar.classList.add('no-footer');
if (!sidebar.classList.contains('no-footer')) {
sidebar.classList.add('no-footer');
}
}
});
}
......
#sidebar {
background: $white;
border-left: 0;
display: inline-block;
height: max-content;
margin-bottom: $page-margin + 35px;
margin-top: 15px;
padding: 0 5px 7px 15px;
......@@ -11,11 +11,7 @@
width: $sidebar-width;
z-index: 2;
&.fixed {
top: 55px;
}
&.was-oversized {
&.adjusted {
height: calc(100vh - 265px);
position: fixed;
overflow-x: hidden;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment