This commit is contained in:
parent
4a9c21b320
commit
6fa5796423
2 changed files with 12 additions and 3 deletions
|
@ -788,14 +788,21 @@ 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) && !hasClosestByClassName(tableBlockElement, "protyle-wysiwyg__embed")) {
|
||||
if (!protyle.disabled && tableBlockElement && tableBlockElement.contains(moveTarget) &&
|
||||
!hasClosestByClassName(tableBlockElement, "protyle-wysiwyg__embed")) {
|
||||
if (moveTarget.classList.contains("table__select")) {
|
||||
moveTarget.classList.add("fn__none");
|
||||
const pointElement = document.elementFromPoint(moveEvent.clientX, moveEvent.clientY);
|
||||
moveTarget.classList.remove("fn__none");
|
||||
moveTarget = hasClosestByMatchTag(pointElement, "TH") || hasClosestByMatchTag(pointElement, "TD");
|
||||
}
|
||||
if (moveTarget && (moveTarget.tagName === "TH" || moveTarget.tagName === "TD") && (!moveCellElement || !moveCellElement.isSameNode(moveTarget))) {
|
||||
if (moveTarget && moveTarget.isSameNode(target)) {
|
||||
tableBlockElement.querySelector(".table__select").removeAttribute("style");
|
||||
moveCellElement = moveTarget;
|
||||
return false;
|
||||
}
|
||||
if (moveTarget && (moveTarget.tagName === "TH" || moveTarget.tagName === "TD") &&
|
||||
(!moveCellElement || !moveCellElement.isSameNode(moveTarget))) {
|
||||
// @ts-ignore
|
||||
tableBlockElement.firstElementChild.style.webkitUserModify = "read-only";
|
||||
let width = target.offsetLeft + target.clientWidth - moveTarget.offsetLeft;
|
||||
|
|
|
@ -157,7 +157,9 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
|
|||
}
|
||||
// 在数学公式输入框中撤销到最后一步,再继续撤销会撤销编辑器正文内容,从而出发 input 事件
|
||||
hideElements(["util"], protyle, true);
|
||||
|
||||
if (type === "NodeTable") {
|
||||
blockElement.querySelector(".table__select").removeAttribute("style")
|
||||
}
|
||||
const tempElement = document.createElement("template");
|
||||
tempElement.innerHTML = html;
|
||||
if (needRender && (
|
||||
|
|
Loading…
Add table
Reference in a new issue