This commit is contained in:
Vanessa 2023-10-27 11:34:53 +08:00
parent 5cdf81581c
commit 0ca398e3f7
4 changed files with 13 additions and 6 deletions

View File

@ -215,6 +215,10 @@
top: 8px; top: 8px;
} }
&.dragover__right {
border-right-color: var(--b3-theme-primary-lighter);
}
&--select { &--select {
background-color: var(--b3-theme-primary-lightest); background-color: var(--b3-theme-primary-lightest);
box-shadow: 2px 2px 0 var(--b3-theme-primary-lighter) inset, -2px -2px 0px var(--b3-theme-primary-lighter) inset; box-shadow: 2px 2px 0 var(--b3-theme-primary-lighter) inset, -2px -2px 0px var(--b3-theme-primary-lighter) inset;

View File

@ -9,16 +9,16 @@
&__bottom { &__bottom {
border-radius: 0 !important; border-radius: 0 !important;
box-shadow: 0 2px 0 var(--b3-theme-primary-lighter), inset 0px -2px 0 var(--b3-theme-primary-lighter) !important; box-shadow: 0 2px 0 var(--b3-theme-primary-lighter), inset 0 -2px 0 var(--b3-theme-primary-lighter) !important;
} }
&__left { &__left {
border-radius: 0 !important; border-radius: 0 !important;
box-shadow: -4px 0 0 var(--b3-theme-primary-lighter) !important; box-shadow: -3px 0 0 var(--b3-theme-primary-lighter), inset 1px 0 0 var(--b3-theme-primary-lighter) !important;
} }
&__right { &__right {
border-radius: 0 !important; border-radius: 0 !important;
box-shadow: 4px 0 0 var(--b3-theme-primary-lighter) !important; box-shadow: 1px 0 0 var(--b3-theme-primary-lighter), inset -2px 0 0 var(--b3-theme-primary-lighter) !important;
} }
} }

View File

@ -1070,7 +1070,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
// 左侧 // 左侧
point.x = editorPosition.left; point.x = editorPosition.left;
point.className = "dragover__left"; point.className = "dragover__left";
} else if (event.clientX > editorPosition.right) { } else if (event.clientX >= editorPosition.right) {
// 右侧 // 右侧
point.x = editorPosition.right - 6; point.x = editorPosition.right - 6;
point.className = "dragover__right"; point.className = "dragover__right";
@ -1121,13 +1121,13 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
if (event.clientX < nodeRect.left + nodeRect.width / 2 && event.clientX > nodeRect.left && if (event.clientX < nodeRect.left + nodeRect.width / 2 && event.clientX > nodeRect.left &&
!targetElement.classList.contains("av__row")) { !targetElement.classList.contains("av__row")) {
targetElement.classList.add("dragover__left"); targetElement.classList.add("dragover__left");
} else if (event.clientX > nodeRect.right - nodeRect.width / 2 && event.clientX < nodeRect.right && } else if (event.clientX > nodeRect.right - nodeRect.width / 2 && event.clientX <= nodeRect.right + 1 &&
!targetElement.classList.contains("av__row")) { !targetElement.classList.contains("av__row")) {
targetElement.classList.add("dragover__right"); targetElement.classList.add("dragover__right");
} }
return; return;
} }
if (event.clientX < nodeRect.left + 32 && event.clientX > nodeRect.left && if (event.clientX < nodeRect.left + 32 && event.clientX >= nodeRect.left - 1 &&
!targetElement.classList.contains("av__row")) { !targetElement.classList.contains("av__row")) {
targetElement.classList.add("dragover__left"); targetElement.classList.add("dragover__left");
} else if (event.clientX > nodeRect.right - 32 && event.clientX < nodeRect.right && } else if (event.clientX > nodeRect.right - 32 && event.clientX < nodeRect.right &&

View File

@ -395,6 +395,9 @@ export class WYSIWYG {
documentSelf.ondragstart = null; documentSelf.ondragstart = null;
documentSelf.onselectstart = null; documentSelf.onselectstart = null;
documentSelf.onselect = null; documentSelf.onselect = null;
if (!newWidth || newWidth !== oldWidth + "px") {
return;
}
transaction(protyle, [{ transaction(protyle, [{
action: "setAttrViewColWidth", action: "setAttrViewColWidth",
id: dragColId, id: dragColId,