Vanessa 2025-02-18 21:45:53 +08:00
parent 22a6c34d94
commit fd42a78e25
2 changed files with 227 additions and 223 deletions

View File

@ -409,11 +409,11 @@
}
}
table[contenteditable="false"] + .protyle-action__table {
table[contenteditable="false"] + .protyle-action__table > .table__resize {
display: none;
}
table[contenteditable="true"] + .protyle-action__table {
table + .protyle-action__table {
position: absolute;
top: 4px;
height: 0;

View File

@ -811,7 +811,7 @@ export class WYSIWYG {
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
let moveTarget: boolean | HTMLElement = moveEvent.target as HTMLElement;
// table cell select
if (!protyle.disabled && tableBlockElement && tableBlockElement.contains(moveTarget) &&
if (tableBlockElement && tableBlockElement.contains(moveTarget) &&
!hasClosestByClassName(tableBlockElement, "protyle-wysiwyg__embed")) {
if (moveTarget.classList.contains("table__select")) {
moveTarget.classList.add("fn__none");
@ -1084,7 +1084,7 @@ export class WYSIWYG {
});
protyle.selectElement.classList.add("fn__none");
protyle.selectElement.removeAttribute("style");
if (!protyle.disabled && tableBlockElement) {
if (tableBlockElement) {
// @ts-ignore
tableBlockElement.firstElementChild.style.webkitUserModify = "";
const tableSelectElement = tableBlockElement.querySelector(".table__select") as HTMLElement;
@ -1093,6 +1093,7 @@ export class WYSIWYG {
getSelection().getRangeAt(0).collapse(false);
}
window.siyuan.menus.menu.remove();
if (!protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.mergeCell,
click: () => {
@ -1294,6 +1295,7 @@ export class WYSIWYG {
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
}
window.siyuan.menus.menu.append(new MenuItem({
icon: "iconCopy",
accelerator: "⌘C",
@ -1305,6 +1307,7 @@ export class WYSIWYG {
}
}
}).element);
if (!protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({
icon: "iconCut",
accelerator: "⌘X",
@ -1341,6 +1344,7 @@ export class WYSIWYG {
}
}
}).element);
}
window.siyuan.menus.menu.popup({x: mouseUpEvent.clientX - 8, y: mouseUpEvent.clientY - 16});
}
}