This commit is contained in:
Vanessa 2022-05-29 10:06:02 +08:00
parent 125aa092c6
commit 259198a3d5
8 changed files with 10 additions and 11 deletions

View file

@ -213,11 +213,11 @@ export const setTitle = (title: string) => {
const versionTitle = title + " v" + Constants.SIYUAN_VERSION;
document.title = versionTitle;
dragElement.textContent = versionTitle;
dragElement.setAttribute("title", versionTitle)
dragElement.setAttribute("title", versionTitle);
} else {
document.title = title + " - " + window.siyuan.languages.siyuanNote + " v" + Constants.SIYUAN_VERSION;
dragElement.textContent = title;
dragElement.setAttribute("title", title)
dragElement.setAttribute("title", title);
}
};

View file

@ -381,7 +381,7 @@ export class Wnd {
event.preventDefault();
});
}
const containerElement = this.element.querySelector(".layout-tab-container")
const containerElement = this.element.querySelector(".layout-tab-container");
if (!containerElement.querySelector(".fn__flex-1")) {
// empty center
containerElement.append(tab.panelElement);

View file

@ -2,7 +2,6 @@ import {hasClosestByAttribute} from "../util/hasClosest";
import {fetchPost} from "../../util/fetch";
import {processRender} from "../util/processCode";
import {highlightRender} from "./highlightRender";
import {mediaRender} from "./mediaRender";
import {Constants} from "../../constants";
export const blockRender = (protyle: IProtyle, element: Element) => {

View file

@ -1054,7 +1054,7 @@ export class Toolbar {
languageElement.textContent = this.subElement.querySelector(".b3-list-item--focus").textContent;
localStorage.setItem(Constants.LOCAL_CODELANG, languageElement.textContent);
const editElement = getContenteditableElement(nodeElement);
const lineNumber = nodeElement.getAttribute("linenumber")
const lineNumber = nodeElement.getAttribute("linenumber");
if (lineNumber === "true" || (lineNumber !== "false" && window.siyuan.config.editor.codeSyntaxHighlightLineNum)) {
editElement.classList.add("protyle-linenumber");
} else {
@ -1120,7 +1120,7 @@ export class Toolbar {
const nodeElement = hasClosestBlock(languageElement);
if (nodeElement) {
const editElement = getContenteditableElement(nodeElement);
const lineNumber = nodeElement.getAttribute("linenumber")
const lineNumber = nodeElement.getAttribute("linenumber");
if (lineNumber === "true" || (lineNumber !== "false" && window.siyuan.config.editor.codeSyntaxHighlightLineNum)) {
editElement.classList.add("protyle-linenumber");
} else {

View file

@ -197,7 +197,7 @@ export class WYSIWYG {
if (!nodeElement) {
return;
}
const selectImgElement = nodeElement.querySelector(".img--select")
const selectImgElement = nodeElement.querySelector(".img--select");
let selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
if (selectElements.length === 0 && range.toString() === "" && !range.cloneContents().querySelector("img") &&
!selectImgElement) {
@ -266,7 +266,7 @@ export class WYSIWYG {
if (!nodeElement) {
return;
}
const selectImgElement = nodeElement.querySelector(".img--select")
const selectImgElement = nodeElement.querySelector(".img--select");
let selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
if (selectElements.length === 0 && range.toString() === "" && !range.cloneContents().querySelector("img") &&
!selectImgElement) {

View file

@ -465,7 +465,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (matchHotKey("⌘/", event)) {
event.stopPropagation();
event.preventDefault();
const inlineElement = hasClosestByAttribute(range.startContainer, "data-type", null)
const inlineElement = hasClosestByAttribute(range.startContainer, "data-type", null);
if (inlineElement) {
const type = inlineElement.getAttribute("data-type");
if (type === "block-ref") {

View file

@ -179,7 +179,7 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
processRender(protyle.wysiwyg.element);
highlightRender(protyle.wysiwyg.element);
}
}
};
export const promiseTransactions = () => {
window.siyuan.transactionsTimeout = window.setInterval(() => {

View file

@ -57,7 +57,7 @@ export class Tree {
} else if (item.type === "backlink") {
iconHTML = `<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.nodeType, item.subType)}"></use></svg>`;
} else if (item.type === "NodeHeading") {
iconHTML = `<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type, item.subType)}"></use></svg>`
iconHTML = `<svg class="b3-list-item__graphic popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type, item.subType)}"></use></svg>`;
}
let countHTML = "";
if (item.count) {