don't need to set width with javascript?

pull/21833/head
Bruno Windels 2020-07-03 16:52:01 +02:00
parent 82e0816d86
commit b370e3f078
2 changed files with 1 additions and 3 deletions

View File

@ -71,6 +71,7 @@ limitations under the License.
z-index: 1; // over top of other elements, but still under the ones in the visible list z-index: 1; // over top of other elements, but still under the ones in the visible list
height: 32px; // to match the header container height: 32px; // to match the header container
// width set by JS // width set by JS
width: calc(100% - 22px);
} }
&.mx_RoomSublist2_headerContainer_stickyBottom { &.mx_RoomSublist2_headerContainer_stickyBottom {

View File

@ -119,13 +119,11 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
if (slRect.top + headerHeight > bottom && !gotBottom) { if (slRect.top + headerHeight > bottom && !gotBottom) {
header.classList.add("mx_RoomSublist2_headerContainer_sticky"); header.classList.add("mx_RoomSublist2_headerContainer_sticky");
header.classList.add("mx_RoomSublist2_headerContainer_stickyBottom"); header.classList.add("mx_RoomSublist2_headerContainer_stickyBottom");
header.style.width = `${headerStickyWidth}px`;
header.style.top = `unset`; header.style.top = `unset`;
gotBottom = true; gotBottom = true;
} else if (slRect.top < top) { } else if (slRect.top < top) {
header.classList.add("mx_RoomSublist2_headerContainer_sticky"); header.classList.add("mx_RoomSublist2_headerContainer_sticky");
header.classList.add("mx_RoomSublist2_headerContainer_stickyTop"); header.classList.add("mx_RoomSublist2_headerContainer_stickyTop");
header.style.width = `${headerStickyWidth}px`;
header.style.top = `${rlRect.top}px`; header.style.top = `${rlRect.top}px`;
if (lastTopHeader) { if (lastTopHeader) {
lastTopHeader.style.display = "none"; lastTopHeader.style.display = "none";
@ -137,7 +135,6 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
header.classList.remove("mx_RoomSublist2_headerContainer_sticky"); header.classList.remove("mx_RoomSublist2_headerContainer_sticky");
header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop");
header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom"); header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom");
header.style.width = `unset`;
header.style.top = `unset`; header.style.top = `unset`;
} }
} }