mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +01:00
🚨
This commit is contained in:
parent
e685629c02
commit
46282d22c4
7 changed files with 20 additions and 20 deletions
|
|
@ -921,7 +921,7 @@ export class Files extends Model {
|
||||||
// 文件展开时,刷新
|
// 文件展开时,刷新
|
||||||
liElement.nextElementSibling.remove();
|
liElement.nextElementSibling.remove();
|
||||||
}
|
}
|
||||||
const arrowElement = liElement.querySelector(".b3-list-item__arrow")
|
const arrowElement = liElement.querySelector(".b3-list-item__arrow");
|
||||||
arrowElement.classList.add("b3-list-item__arrow--open");
|
arrowElement.classList.add("b3-list-item__arrow--open");
|
||||||
arrowElement.parentElement.classList.remove("fn__hidden");
|
arrowElement.parentElement.classList.remove("fn__hidden");
|
||||||
liElement.insertAdjacentHTML("afterend", `<ul>${fileHTML}</ul>`);
|
liElement.insertAdjacentHTML("afterend", `<ul>${fileHTML}</ul>`);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {upDownHint} from "../../../util/upDownHint";
|
||||||
import {fetchPost} from "../../../util/fetch";
|
import {fetchPost} from "../../../util/fetch";
|
||||||
import {escapeGreat, escapeHtml} from "../../../util/escape";
|
import {escapeGreat, escapeHtml} from "../../../util/escape";
|
||||||
import {transaction} from "../../wysiwyg/transaction";
|
import {transaction} from "../../wysiwyg/transaction";
|
||||||
import {genCellValueByElement, updateCellsValue} from "./cell";
|
import {updateCellsValue} from "./cell";
|
||||||
import {updateAttrViewCellAnimation} from "./action";
|
import {updateAttrViewCellAnimation} from "./action";
|
||||||
import {focusBlock} from "../../util/selection";
|
import {focusBlock} from "../../util/selection";
|
||||||
import {setPosition} from "../../../util/setPosition";
|
import {setPosition} from "../../../util/setPosition";
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v
|
||||||
if (rowId) {
|
if (rowId) {
|
||||||
selectRowIds.push(rowId);
|
selectRowIds.push(rowId);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
let selectCellId = "";
|
let selectCellId = "";
|
||||||
const selectCellElement = e.querySelector(".av__cell--select") as HTMLElement;
|
const selectCellElement = e.querySelector(".av__cell--select") as HTMLElement;
|
||||||
if (selectCellElement) {
|
if (selectCellElement) {
|
||||||
|
|
@ -146,7 +146,7 @@ style="width: ${column.width || "200px"};">
|
||||||
style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use xlink:href="#iconDown"></use></svg>' + window.siyuan.languages.calc}</div>`;
|
style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use xlink:href="#iconDown"></use></svg>' + window.siyuan.languages.calc}</div>`;
|
||||||
}
|
}
|
||||||
if (column.calc && column.calc.operator !== "") {
|
if (column.calc && column.calc.operator !== "") {
|
||||||
hasCalc = true
|
hasCalc = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pinIndex === index) {
|
if (pinIndex === index) {
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,9 @@ export const insertAttrViewBlockAnimation = (protyle: IProtyle, blockElement: El
|
||||||
colHTML = '<div class="av__colsticky"><div class="av__firstcol av__colsticky"><svg><use xlink:href="#iconUncheck"></use></svg></div>';
|
colHTML = '<div class="av__colsticky"><div class="av__firstcol av__colsticky"><svg><use xlink:href="#iconUncheck"></use></svg></div>';
|
||||||
}
|
}
|
||||||
previousElement.querySelectorAll(".av__cell").forEach((item: HTMLElement, index) => {
|
previousElement.querySelectorAll(".av__cell").forEach((item: HTMLElement, index) => {
|
||||||
let lineNumber = ""
|
let lineNumber = "";
|
||||||
if (getTypeByCellElement(item) === "lineNumber") {
|
if (getTypeByCellElement(item) === "lineNumber") {
|
||||||
const lineNumberValue = item.querySelector(".av__celltext")?.getAttribute("data-value")
|
const lineNumberValue = item.querySelector(".av__celltext")?.getAttribute("data-value");
|
||||||
if (lineNumberValue) {
|
if (lineNumberValue) {
|
||||||
lineNumber = (parseInt(lineNumberValue) + 1).toString();
|
lineNumber = (parseInt(lineNumberValue) + 1).toString();
|
||||||
}
|
}
|
||||||
|
|
@ -168,40 +168,40 @@ ${getTypeByCellElement(item) === "block" ? ' data-detached="true"' : ""}><span c
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 当空或非空外,需要根据值进行判断
|
// 当空或非空外,需要根据值进行判断
|
||||||
let isRenderValue = true
|
let isRenderValue = true;
|
||||||
if (item.operator !== "Is empty" && item.operator !== "Is not empty") {
|
if (item.operator !== "Is empty" && item.operator !== "Is not empty") {
|
||||||
switch (item.value.type) {
|
switch (item.value.type) {
|
||||||
case "select":
|
case "select":
|
||||||
case "mSelect":
|
case "mSelect":
|
||||||
if (!item.value.mSelect || item.value.mSelect.length === 0) {
|
if (!item.value.mSelect || item.value.mSelect.length === 0) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "block":
|
case "block":
|
||||||
if (!item.value.block || !item.value.block.content) {
|
if (!item.value.block || !item.value.block.content) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "number":
|
case "number":
|
||||||
if (!item.value.number || !item.value.number.isNotEmpty) {
|
if (!item.value.number || !item.value.number.isNotEmpty) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "date":
|
case "date":
|
||||||
case "created":
|
case "created":
|
||||||
case "updated":
|
case "updated":
|
||||||
if (!item.value[item.value.type] || !item.value[item.value.type].isNotEmpty) {
|
if (!item.value[item.value.type] || !item.value[item.value.type].isNotEmpty) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "mAsset":
|
case "mAsset":
|
||||||
if (!item.value.mAsset || item.value.mAsset.length === 0) {
|
if (!item.value.mAsset || item.value.mAsset.length === 0) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "checkbox":
|
case "checkbox":
|
||||||
if (!item.value.checkbox) {
|
if (!item.value.checkbox) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "text":
|
case "text":
|
||||||
|
|
@ -209,7 +209,7 @@ ${getTypeByCellElement(item) === "block" ? ' data-detached="true"' : ""}><span c
|
||||||
case "phone":
|
case "phone":
|
||||||
case "email":
|
case "email":
|
||||||
if (!item.value[item.value.type] || !item.value[item.value.type].content) {
|
if (!item.value[item.value.type] || !item.value[item.value.type].content) {
|
||||||
isRenderValue = false
|
isRenderValue = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -652,7 +652,7 @@ export class Toolbar {
|
||||||
let previousIsCTK = false;
|
let previousIsCTK = false;
|
||||||
if (currentPreviousSibling) {
|
if (currentPreviousSibling) {
|
||||||
if (currentPreviousSibling.nodeType === 1) {
|
if (currentPreviousSibling.nodeType === 1) {
|
||||||
const currentPreviousSiblingTypes = currentPreviousSibling.dataset.type.split(" ")
|
const currentPreviousSiblingTypes = currentPreviousSibling.dataset.type.split(" ");
|
||||||
if (currentPreviousSiblingTypes.includes("code") || currentPreviousSiblingTypes.includes("tag") || currentPreviousSiblingTypes.includes("kbd")) {
|
if (currentPreviousSiblingTypes.includes("code") || currentPreviousSiblingTypes.includes("tag") || currentPreviousSiblingTypes.includes("kbd")) {
|
||||||
previousIsCTK = true;
|
previousIsCTK = true;
|
||||||
}
|
}
|
||||||
|
|
@ -664,7 +664,7 @@ export class Toolbar {
|
||||||
let nextIsCTK = false;
|
let nextIsCTK = false;
|
||||||
if (currentNextSibling) {
|
if (currentNextSibling) {
|
||||||
if (currentNextSibling.nodeType === 1) {
|
if (currentNextSibling.nodeType === 1) {
|
||||||
const currentNextSiblingTypes = currentNextSibling.dataset.type.split(" ")
|
const currentNextSiblingTypes = currentNextSibling.dataset.type.split(" ");
|
||||||
if (currentNextSiblingTypes.includes("code") || currentNextSiblingTypes.includes("tag") || currentNextSiblingTypes.includes("kbd")) {
|
if (currentNextSiblingTypes.includes("code") || currentNextSiblingTypes.includes("tag") || currentNextSiblingTypes.includes("kbd")) {
|
||||||
nextIsCTK = true;
|
nextIsCTK = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,5 +169,5 @@ export const getPadding = (protyle: IProtyle) => {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
left, right, bottom, top: 16
|
left, right, bottom, top: 16
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
||||||
let listElement: Element;
|
let listElement: Element;
|
||||||
let topParentElement: Element;
|
let topParentElement: Element;
|
||||||
hideElements(["select"], protyle);
|
hideElements(["select"], protyle);
|
||||||
let foldPreviousId: string
|
let foldPreviousId: string;
|
||||||
selectElements.find((item: HTMLElement) => {
|
selectElements.find((item: HTMLElement) => {
|
||||||
const topElement = getTopAloneElement(item);
|
const topElement = getTopAloneElement(item);
|
||||||
topParentElement = topElement.parentElement;
|
topParentElement = topElement.parentElement;
|
||||||
|
|
@ -75,7 +75,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
||||||
if (topElement.getAttribute("data-type") === "NodeHeading" && topElement.getAttribute("fold") === "1") {
|
if (topElement.getAttribute("data-type") === "NodeHeading" && topElement.getAttribute("fold") === "1") {
|
||||||
// https://github.com/siyuan-note/siyuan/issues/2188
|
// https://github.com/siyuan-note/siyuan/issues/2188
|
||||||
setFold(protyle, topElement, undefined, true);
|
setFold(protyle, topElement, undefined, true);
|
||||||
let previousID = topElement.previousElementSibling ? topElement.previousElementSibling.getAttribute("data-node-id") : ""
|
let previousID = topElement.previousElementSibling ? topElement.previousElementSibling.getAttribute("data-node-id") : "";
|
||||||
if (typeof foldPreviousId !== "undefined") {
|
if (typeof foldPreviousId !== "undefined") {
|
||||||
previousID = foldPreviousId;
|
previousID = foldPreviousId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue