This commit is contained in:
Vanessa 2024-09-29 10:55:24 +08:00
parent e80354ebbb
commit 5cdcd27faa
7 changed files with 10 additions and 10 deletions

View file

@ -93,7 +93,7 @@ export const initBlockPopover = (app: App) => {
showTooltip(notebookItemElement.getAttribute("aria-label") || "", notebookItemElement);
fetchPost("/api/notebook/getNotebookInfo", {notebook: notebookItemElement.parentElement.parentElement.getAttribute("data-url")}, (response) => {
const boxData = response.data.boxInfo;
const tip = `${boxData.name} <small class='ft__on-surface'>${boxData.hSize}</small>${boxData.docCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", boxData.docCount) : ""}<br>${window.siyuan.languages.modifiedAt} ${boxData.hMtime}<br>${window.siyuan.languages.createdAt} ${boxData.hCtime}`
const tip = `${boxData.name} <small class='ft__on-surface'>${boxData.hSize}</small>${boxData.docCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", boxData.docCount) : ""}<br>${window.siyuan.languages.modifiedAt} ${boxData.hMtime}<br>${window.siyuan.languages.createdAt} ${boxData.hCtime}`;
const scopeNotebookItemElement = hasClosestByClassName(event.target, "b3-list-item__text");
if (notebookItemElement && scopeNotebookItemElement && notebookItemElement.isSameNode(scopeNotebookItemElement)) {
@ -104,7 +104,7 @@ export const initBlockPopover = (app: App) => {
scopeNotebookItemElement.parentElement.parentElement.getAttribute("data-url") === boxData.id) {
scopeNotebookItemElement.setAttribute("aria-label", tip);
}
})
});
} else {
const tipElement = hasClosestByAttribute(event.target, "id", "tooltip", true);
if (!tipElement || (

View file

@ -239,7 +239,7 @@ export const exportConfig = {
fetchPost("/api/system/importConf", formData, response => {
if (response.code !== 0) {
showMessage(response.msg);
return
return;
}
showMessage(window.siyuan.languages.imported);

View file

@ -1129,7 +1129,7 @@ export class Files extends Model {
if (item.count && item.count > 0) {
countHTML = `<span class="popover__block counter b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.ref}">${item.count}</span>`;
}
const ariaLabel = this.genDocAriaLabel(item)
const ariaLabel = this.genDocAriaLabel(item);
return `<li data-node-id="${item.id}" data-name="${Lute.EscapeHTMLStr(item.name)}" draggable="true" data-count="${item.subFileCount}"
data-type="navigation-file"
style="--file-toggle-width:${(item.path.split("/").length - 2) * 18 + 40}px"
@ -1148,7 +1148,7 @@ aria-label="${escapeHtml(ariaLabel)}">${getDisplayName(item.name, true, true)}</
</span>
${countHTML}
</li>`;
};
}
private initMoreMenu() {
window.siyuan.menus.menu.remove();

View file

@ -229,7 +229,7 @@ export const exportLayout = async (options: {
cb: () => void,
errorExit: boolean
}) => {
const editors = getAllModels().editor
const editors = getAllModels().editor;
for (let i = 0; i < editors.length; i++) {
await saveScroll(editors[i].editor.protyle);
}

View file

@ -45,7 +45,7 @@ export const saveScroll = (protyle: IProtyle, getObject = false) => {
setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION], () => {
resolve(true);
});
})
});
};
export const getDocByScroll = (options: {

View file

@ -5,7 +5,7 @@ import * as dayjs from "dayjs";
import {transaction, updateTransaction} from "./transaction";
import {mathRender} from "../render/mathRender";
import {highlightRender} from "../render/highlightRender";
import {getContenteditableElement, getNextBlock, hasNextSibling, isNotEditBlock} from "./getBlock";
import {getContenteditableElement, hasNextSibling, isNotEditBlock} from "./getBlock";
import {genEmptyBlock} from "../../block/util";
import {blockRender} from "../render/blockRender";
import {hideElements} from "../ui/hideElements";

View file

@ -735,7 +735,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.preventDefault();
} else if (nodeEditableElement?.innerText.substr(position.end).indexOf("\n") === -1 || position.end >= nodeEditableElement.innerText.trimEnd().length) {
// 需使用 innerText否则 td 中的 br 无法转换为 \n; position.end 不能加1否则倒数第二行行末无法下移
range.collapse(false)
range.collapse(false);
const nextFoldElement = getNextBlock(nodeElement) as HTMLElement;
if (nextFoldElement) {
if(nodeEditableElement.getBoundingClientRect().bottom - getSelectionPosition(nodeElement, range).top < 40) {
@ -844,7 +844,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
}
if (nextSibling.nodeType === 1 && nextSibling.classList.contains("img")) {
// 光标需在图片前 https://github.com/siyuan-note/siyuan/issues/12452
const textPosition = getSelectionOffset(range.startContainer, protyle.wysiwyg.element, range)
const textPosition = getSelectionOffset(range.startContainer, protyle.wysiwyg.element, range);
if (textPosition.start === range.startContainer.textContent.length) {
removeImage(nextSibling as Element, nodeElement, range, protyle);
event.stopPropagation();