mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-09 22:22:34 +01:00
🚨
This commit is contained in:
parent
6684c77120
commit
2008dcaff2
7 changed files with 18 additions and 24 deletions
|
|
@ -21,12 +21,6 @@ import {hintRef} from "../../hint/extend";
|
|||
import {focusByRange} from "../../util/selection";
|
||||
import {showMessage} from "../../../dialog/message";
|
||||
import {previewImage} from "../../preview/image";
|
||||
import {pathPosix} from "../../../util/pathName";
|
||||
import {Constants} from "../../../constants";
|
||||
/// #if !MOBILE
|
||||
import {openAsset, openBy} from "../../../editor/util";
|
||||
/// #endif
|
||||
import {getSearch} from "../../../util/functions";
|
||||
import {unicode2Emoji} from "../../../emoji";
|
||||
import {selectRow} from "./row";
|
||||
import * as dayjs from "dayjs";
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
|
|||
const targetElement = element.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;
|
||||
if (targetElement && dragBlockElement) {
|
||||
const isBottom = targetElement.classList.contains("dragover__bottom");
|
||||
const previousID = isBottom ? targetElement.dataset.colId : targetElement.previousElementSibling?.getAttribute("data-col-id")
|
||||
const undoPreviousID = window.siyuan.dragElement.previousElementSibling?.getAttribute("data-col-id")
|
||||
const previousID = isBottom ? targetElement.dataset.colId : targetElement.previousElementSibling?.getAttribute("data-col-id");
|
||||
const undoPreviousID = window.siyuan.dragElement.previousElementSibling?.getAttribute("data-col-id");
|
||||
if (previousID !== undoPreviousID && previousID !== window.siyuan.dragElement.dataset.colId) {
|
||||
transaction(protyle, [{
|
||||
action: "sortAttrViewCol",
|
||||
|
|
|
|||
|
|
@ -793,7 +793,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
|||
click() {
|
||||
const addMenu = addCol(protyle, blockElement, cellElement.previousElementSibling?.getAttribute("data-col-id") || "");
|
||||
if (!blockElement.contains(cellElement)) {
|
||||
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`)
|
||||
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`);
|
||||
}
|
||||
const addRect = cellElement.getBoundingClientRect();
|
||||
addMenu.open({
|
||||
|
|
@ -809,7 +809,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
|||
click() {
|
||||
const addMenu = addCol(protyle, blockElement, colId);
|
||||
if (!blockElement.contains(cellElement)) {
|
||||
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`)
|
||||
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`);
|
||||
}
|
||||
const addRect = cellElement.getBoundingClientRect();
|
||||
addMenu.open({
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ export const openMenuPanel = (options: {
|
|||
}
|
||||
|
||||
if (targetElement.getAttribute("data-type") === "editCol") {
|
||||
const previousID = (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || ""
|
||||
const previousID = (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || "";
|
||||
const undoPreviousID = sourceElement.previousElementSibling?.getAttribute("data-id") || "";
|
||||
if (previousID !== undoPreviousID && previousID !== sourceId) {
|
||||
transaction(options.protyle, [{
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ const updateCol = (options: {
|
|||
}
|
||||
colData.rollup = {
|
||||
relationKeyID: itemElement.dataset.colId
|
||||
}
|
||||
const goSearchRollupTargetElement = options.target.nextElementSibling as HTMLElement
|
||||
};
|
||||
const goSearchRollupTargetElement = options.target.nextElementSibling as HTMLElement;
|
||||
goSearchRollupTargetElement.querySelector(".b3-menu__accelerator").textContent = "";
|
||||
goSearchRollupTargetElement.setAttribute("data-av-id", itemElement.dataset.targetAvId);
|
||||
const goSearchRollupCalcElement = goSearchRollupTargetElement.nextElementSibling as HTMLElement;
|
||||
goSearchRollupCalcElement.removeAttribute("data-col-type")
|
||||
goSearchRollupCalcElement.removeAttribute("data-calc")
|
||||
goSearchRollupCalcElement.removeAttribute("data-col-type");
|
||||
goSearchRollupCalcElement.removeAttribute("data-calc");
|
||||
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
|
||||
} else {
|
||||
if (itemElement.dataset.colId === colData.rollup?.keyID) {
|
||||
|
|
@ -49,7 +49,7 @@ const updateCol = (options: {
|
|||
colData.rollup.keyID = itemElement.dataset.colId;
|
||||
delete colData.rollup.calc;
|
||||
const goSearchRollupCalcElement = options.target.nextElementSibling as HTMLElement;
|
||||
goSearchRollupCalcElement.removeAttribute("data-calc")
|
||||
goSearchRollupCalcElement.removeAttribute("data-calc");
|
||||
goSearchRollupCalcElement.setAttribute("data-col-type", itemElement.dataset.colType);
|
||||
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue