This commit is contained in:
Vanessa 2022-12-28 21:17:11 +08:00
parent e09114c518
commit 28b79219e3
2 changed files with 17 additions and 5 deletions

View File

@ -53,7 +53,8 @@ class PDFSidebarResizer {
* @type {number}
*/
get outerContainerWidth() {
return (this._outerContainerWidth ||= this.outerContainer.clientWidth);
// NOTE
return this.outerContainer.clientWidth;
}
/**
@ -63,7 +64,8 @@ class PDFSidebarResizer {
_updateWidth(width = 0) {
// Prevent the sidebar from becoming too narrow, or from occupying more
// than half of the available viewer width.
const maxWidth = Math.floor(this.outerContainerWidth / 2);
// NOTE
const maxWidth = Math.floor(this.outerContainerWidth / 3 * 2);
if (width > maxWidth) {
width = maxWidth;
}
@ -84,6 +86,7 @@ class PDFSidebarResizer {
* @private
*/
_mouseMove(evt) {
// NOTE
let width = evt.clientX - this.outerContainer.getBoundingClientRect().left;
// For sidebar resizing to work correctly in RTL mode, invert the width.
if (this.isRTL) {

View File

@ -224,13 +224,22 @@
position: absolute;
top: 0;
bottom: 0;
width: 1px;
width: 6px;
z-index: 200;
cursor: ew-resize;
right: -6px;
background-color: var(--b3-border-color);
&:hover {
&:after {
content: "";
width: 1px;
height: 100%;
background-color: var(--b3-border-color);
position: absolute;
top: 0;
left: 3px;
}
&:hover:after {
background-color: var(--b3-scroll-color);
}
}