mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
bbbdda7ef0
commit
6109e8a3c3
3 changed files with 12 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import {fetchPost} from "../../../util/fetch";
|
||||
import {getColIconByType} from "./col";
|
||||
import {Constants} from "../../../constants";
|
||||
import {getCalcValue} from "./cell";
|
||||
import {getCalcValue, popTextCell} from "./cell";
|
||||
import * as dayjs from "dayjs";
|
||||
import {unicode2Emoji} from "../../../emoji";
|
||||
import {focusBlock} from "../../util/selection";
|
||||
|
|
@ -177,8 +177,8 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||
<div class="layout-tab-bar fn__flex">
|
||||
${tabHTML}
|
||||
<div class="fn__flex-1"></div>
|
||||
${response.data.isMirror?` <span class="block__icon block__icon--show b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.mirrorTip}">
|
||||
<svg><use xlink:href="#iconSplitLR"></use></svg></span><div class="fn__space"></div>`:""}
|
||||
${response.data.isMirror ? ` <span class="block__icon block__icon--show b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.mirrorTip}">
|
||||
<svg><use xlink:href="#iconSplitLR"></use></svg></span><div class="fn__space"></div>` : ""}
|
||||
<span data-type="av-filter" class="block__icon block__icon--show b3-tooltips b3-tooltips__w${data.filters.length > 0 ? " block__icon--active" : ""}" aria-label="${window.siyuan.languages.filter}">
|
||||
<svg><use xlink:href="#iconFilter"></use></svg>
|
||||
</span>
|
||||
|
|
@ -236,7 +236,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||
|
||||
let lastParentID: string;
|
||||
let lastElement: HTMLElement;
|
||||
export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||
export const refreshAV = (protyle: IProtyle, operation: IOperation, isUndo: boolean) => {
|
||||
if (operation.action === "setAttrViewName") {
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {
|
||||
const titleElement = item.querySelector(".av__title") as HTMLElement;
|
||||
|
|
@ -267,9 +267,15 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
|||
} else {
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => {
|
||||
item.removeAttribute("data-render");
|
||||
avRender(item, protyle);
|
||||
avRender(item, protyle, () => {
|
||||
// https://github.com/siyuan-note/siyuan/issues/9599
|
||||
if (!isUndo && operation.action === "insertAttrViewBlock" && operation.isDetached) {
|
||||
popTextCell(protyle, [item.querySelector(`.av__row[data-id="${operation.srcIDs[0]}"] > .av__cell[data-detached="true"]`)], "block");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
lastParentID = null;
|
||||
}, Constants.TIMEOUT_TRANSITION);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue