mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 22:10:49 +08:00
This commit is contained in:
parent
e09114c518
commit
28b79219e3
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user