Vanessa 2024-10-29 12:08:37 +08:00
parent 3110b3e1fb
commit 63badb1c74
6 changed files with 10 additions and 6 deletions

View file

@ -481,6 +481,10 @@
&-background__img img {
height: 200px;
}
&-scroll {
right: 0;
}
}
.av__views .block__icon {

View file

@ -6,7 +6,7 @@
.protyle-scroll {
--b3-dynamicscroll-width: 200px;
position: absolute;
right: 0;
right: 10px;
top: 30px;
width: 16px;
bottom: 9px; // 下图标 hover 需要留出一定的空间

View file

@ -195,7 +195,7 @@ export class BlockPanel {
}
// 由于 afterCB 中高度的设定,需在之后再进行设定
// 49 = 16上图标+16下图标+8padding+9底部距离
editor.protyle.scroll.element.parentElement.setAttribute("style", `--b3-dynamicscroll-width:${Math.min(editor.protyle.contentElement.clientHeight - 49, 200)}px;${isMobile() ? "" : "right:10px"}`);
editor.protyle.scroll.element.parentElement.setAttribute("style", `--b3-dynamicscroll-width:${Math.min(editor.protyle.contentElement.clientHeight - 49, 200)}px;`);
}
});
this.editors.push(editor);

View file

@ -17,9 +17,6 @@ export class Scroll {
constructor(protyle: IProtyle) {
this.parentElement = document.createElement("div");
this.parentElement.classList.add("protyle-scroll");
if (!isMobile()) {
this.parentElement.style.right = "10px";
}
this.parentElement.innerHTML = `<div class="protyle-scroll__up ariaLabel" data-position="right4top" aria-label="${updateHotkeyTip("⌘Home")}">
<svg><use xlink:href="#iconUp"></use></svg>
</div>

View file

@ -11,6 +11,9 @@ export const resize = (protyle: IProtyle) => {
const MIN_ABS = 4;
// 不能 clearTimeout否则 split 时左侧无法 resize
setTimeout(() => {
if (protyle.scroll && protyle.scroll.element.parentElement.getAttribute("style")) {
protyle.scroll.element.parentElement.setAttribute("style", `--b3-dynamicscroll-width:${Math.min(protyle.contentElement.clientHeight - 49, 200)}px`);
}
if (!protyle.disabled) {
const contentRect = protyle.contentElement.getBoundingClientRect();
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {

View file

@ -519,7 +519,7 @@ export class WYSIWYG {
}
nodeElement.querySelectorAll(".av__row").forEach((rowElement: HTMLElement, index: number) => {
if ((newIndex.rowIndex < firstCellIndex.rowIndex && index >= newIndex.rowIndex && index < firstCellIndex.rowIndex) ||
(newIndex.rowIndex > dragFillCellIndex.rowIndex && index <= newIndex.rowIndex&& index > dragFillCellIndex.rowIndex)) {
(newIndex.rowIndex > dragFillCellIndex.rowIndex && index <= newIndex.rowIndex && index > dragFillCellIndex.rowIndex)) {
rowElement.querySelectorAll(".av__cell").forEach((cellElement: HTMLElement, cellIndex: number) => {
if (cellIndex >= firstCellIndex.celIndex && cellIndex <= newIndex.celIndex) {
cellElement.classList.add("av__cell--active");