This commit is contained in:
Vanessa 2023-10-13 10:14:11 +08:00
parent 8998de9d81
commit 55fb8b19ab
4 changed files with 21 additions and 6 deletions

View file

@ -207,6 +207,12 @@
top: 8px;
}
&--select {
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;
border-radius: var(--b3-border-radius);
}
.block__icon {
position: absolute;
right: 5px;

View file

@ -45,6 +45,7 @@ import {hideElements} from "../protyle/ui/hideElements";
import {emitOpenMenu} from "../plugin/EventBus";
import {openMobileFileById} from "../mobile/editor";
import {openBacklink, openGraph} from "../layout/dock/util";
import {updateHeader} from "../protyle/render/av/col";
export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement) => {
const nodeElement = hasClosestBlock(refElement);
@ -1663,8 +1664,11 @@ export const setFold = (protyle: IProtyle, nodeElement: Element, isOpen?: boolea
focusBlock(nodeElement, undefined, false);
}
}
nodeElement.querySelectorAll(".img--select").forEach((item) => {
item.classList.remove("img--select");
nodeElement.querySelectorAll(".img--select, .av__cell--select, .av__row--select").forEach((item:HTMLElement) => {
if (item.classList.contains("av__row--select")) {
updateHeader(item);
}
item.classList.remove("img--select", "av__cell--select", "av__row--select");
});
}
const id = nodeElement.getAttribute("data-node-id");

View file

@ -490,6 +490,7 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem
if (doOperations.length > 0) {
transaction(protyle, doOperations, undoOperations);
}
cellElements[0].classList.add("av__cell--select");
setTimeout(() => {
avMaskElement.remove();
});

View file

@ -76,6 +76,7 @@ import {removeSearchMark} from "../toolbar/util";
import {activeBlur, hideKeyboardToolbar} from "../../mobile/util/keyboardToolbar";
import {commonClick} from "./commonClick";
import {avClick, avContextmenu, updateAVName} from "../render/av/action";
import {updateHeader} from "../render/av/col";
export class WYSIWYG {
public lastHTMLs: { [key: string]: string } = {};
@ -185,10 +186,13 @@ export class WYSIWYG {
private setEmptyOutline(protyle: IProtyle, element: HTMLElement) {
// 图片移除选择状态应放在前面,否则 https://github.com/siyuan-note/siyuan/issues/4173
const selectImgElement = protyle.wysiwyg.element.querySelector(".img--select");
if (selectImgElement) {
selectImgElement.classList.remove("img--select");
}
protyle.wysiwyg.element.querySelectorAll(".img--select, .av__cell--select, .av__row--select").forEach((item: HTMLElement) => {
if (item.classList.contains("av__row--select")) {
updateHeader(item);
}
item.classList.remove("img--select", "av__cell--select", "av__row--select");
});
let nodeElement = element;
if (!element.getAttribute("data-node-id")) {
const tempElement = hasClosestBlock(element);