This commit is contained in:
Vanessa 2024-04-07 23:58:24 +08:00
parent b3c39f450b
commit c978a42d3f
10 changed files with 16 additions and 18 deletions

View File

@ -470,6 +470,6 @@ export class Outline extends Model {
currentElement.classList.add("b3-list-item--focus");
}
}
this.element.removeAttribute("data-loading")
this.element.removeAttribute("data-loading");
}
}

View File

@ -15,7 +15,7 @@ import {zoomOut} from "../../menus/protyle";
import {getEditorRange} from "../util/selection";
/// #if !MOBILE
import {openFileById} from "../../editor/util";
import {saveLayout, setPanelFocus} from "../../layout/util";
import {saveLayout} from "../../layout/util";
/// #endif
/// #if !BROWSER
import {ipcRenderer} from "electron";
@ -565,7 +565,7 @@ ${padHTML}
let range: Range;
let blockElement: Element;
if (nodeElement) {
blockElement = nodeElement
blockElement = nodeElement;
} else if (getSelection().rangeCount > 0) {
range = getSelection().getRangeAt(0);
if (!protyle.wysiwyg.element.isEqualNode(range.startContainer) && !protyle.wysiwyg.element.contains(range.startContainer)) {

View File

@ -14,8 +14,7 @@ import {Constants} from "../../constants";
import {matchHotKey} from "../util/hotKey";
import {isMac, readText, writeText} from "../util/compatibility";
import * as dayjs from "dayjs";
import {setPanelFocus} from "../../layout/util";
import {openFileById, updatePanelByEditor} from "../../editor/util";
import {openFileById} from "../../editor/util";
import {setTitle} from "../../dialog/processSystem";
import {getNoContainerElement} from "../wysiwyg/getBlock";
import {commonHotkey} from "../wysiwyg/commonHotkey";

View File

@ -10,9 +10,8 @@ import {getSearch, isMobile} from "../../util/functions";
import {shell} from "electron";
/// #endif
/// #if !MOBILE
import {openAsset, openBy, updateOutline} from "../../editor/util";
import {openAsset, openBy} from "../../editor/util";
import {getAllModels} from "../../layout/getAll";
import {setPanelFocus} from "../../layout/util";
/// #endif
import {fetchPost} from "../../util/fetch";
import {processRender} from "../util/processCode";

View File

@ -304,9 +304,9 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
rowElement.querySelector(".av__firstcol use").setAttribute("xlink:href", "#iconCheck");
const rowElements = blockElement.querySelectorAll(".av__row--select:not(.av__row--header)");
updateHeader(rowElement);
const keyCellElement = rowElements[0].querySelector('.av__cell[data-block-id]') as HTMLElement
const keyCellElement = rowElements[0].querySelector(".av__cell[data-block-id]") as HTMLElement;
if (rowElements.length === 1 && keyCellElement.getAttribute("data-detached") !== "true") {
const blockId = rowElements[0].getAttribute("data-id")
const blockId = rowElements[0].getAttribute("data-id");
openEditorTab(protyle.app, blockId);
menu.addItem({
label: window.siyuan.languages.copy,
@ -318,7 +318,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
label: window.siyuan.languages.unbindBlock,
icon: "iconLinkOff",
click() {
updateCellsValue(protyle, blockElement, keyCellElement.querySelector(".av__celltext").textContent, [keyCellElement])
updateCellsValue(protyle, blockElement, keyCellElement.querySelector(".av__celltext").textContent, [keyCellElement]);
}
});
}

View File

@ -726,7 +726,7 @@ const renderRollup = (cellValue: IAVCellValue) => {
} else if (cellValue.type === "date") {
const dataValue = cellValue ? cellValue.date : null;
if (dataValue.formattedContent) {
text = dataValue.formattedContent
text = dataValue.formattedContent;
} else {
if (dataValue && dataValue.isNotEmpty) {
text = dayjs(dataValue.content).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");

View File

@ -220,7 +220,7 @@ export const getEditHTML = (options: {
<button class="b3-menu__item" data-type="removeCol">
<svg class="b3-menu__icon" style=""><use xlink:href="#iconTrashcan"></use></svg>
<span class="b3-menu__label">${window.siyuan.languages.delete}</span>
</button>`
</button>`;
}
return `<div class="b3-menu__items">
${html}
@ -352,7 +352,7 @@ export const bindEditEvent = (options: {
data: !wrapElement.checked,
blockID: options.blockID
}]);
})
});
}
const addOptionElement = options.menuElement.querySelector('[data-type="addOption"]') as HTMLInputElement;
if (addOptionElement) {
@ -863,7 +863,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
colId,
data: response.data
});
})
});
}
});
}

View File

@ -73,7 +73,7 @@ export const bindDateEvent = (options: {
inputElements.forEach(item => {
item.addEventListener("keydown", (event) => {
if (event.isComposing) {
return
return;
}
if (event.key === "Enter") {
updateCellsValue(options.protyle, options.blockElement as HTMLElement, {
@ -87,7 +87,7 @@ export const bindDateEvent = (options: {
document.querySelector(".av__panel")?.remove();
}
});
})
});
inputElements[0].addEventListener("change", () => {
inputElements[0].dataset.value = inputElements[0].value.length > 10 ? inputElements[0].value : inputElements[0].value + " 00:00";
});

View File

@ -28,7 +28,7 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
event.preventDefault();
return true;
}
const avPanelElement = document.querySelector(".av__panel")
const avPanelElement = document.querySelector(".av__panel");
if (avPanelElement &&
(event.key === "Escape" || event.key.startsWith("ArrowLeft") || event.key === "Enter" || matchHotKey("⇥", event) || matchHotKey("⇧⇥", event))) {
avPanelElement.remove();

View File

@ -150,7 +150,7 @@ export const bindViewEvent = (options: {
}]);
options.blockElement.querySelector(".av__title").classList.remove("av__title--hide");
}
})
});
};
export const getViewHTML = (data: IAVTable) => {