mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 11:00:52 +08:00
🎨 Clean code
This commit is contained in:
parent
427bf25a88
commit
b22a70cf65
@ -339,7 +339,7 @@ export const bindCardEvent = async (options: {
|
||||
deckID: Constants.QUICK_DECK_ID,
|
||||
blockIDs: [currentCard.blockID],
|
||||
}, () => {
|
||||
const minLang = window.siyuan.languages._time["1m"].replace("%s", "")
|
||||
const minLang = window.siyuan.languages._time["1m"].replace("%s", "");
|
||||
currentCard.lapses = 0;
|
||||
currentCard.lastReview = -62135596800000;
|
||||
currentCard.reps = 0;
|
||||
|
@ -548,7 +548,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
|
||||
iconElement.classList.add("b3-list-item__arrow--open");
|
||||
let html = "";
|
||||
response.data.items.forEach((docItem: { title: string, path: string, op: string }) => {
|
||||
let chipClass = " b3-chip b3-chip--list "
|
||||
let chipClass = " b3-chip b3-chip--list ";
|
||||
if (docItem.op === "clean") {
|
||||
chipClass += "b3-chip--primary ";
|
||||
} else if (docItem.op === "update") {
|
||||
|
@ -2,11 +2,13 @@ import {Divider} from "./Divider";
|
||||
import {Font, hasSameTextStyle, setFontStyle} from "./Font";
|
||||
import {ToolbarItem} from "./ToolbarItem";
|
||||
import {
|
||||
fixTableRange, focusBlock,
|
||||
fixTableRange,
|
||||
focusBlock,
|
||||
focusByRange,
|
||||
focusByWbr,
|
||||
getEditorRange,
|
||||
getSelectionPosition, selectAll,
|
||||
getSelectionPosition,
|
||||
selectAll,
|
||||
setFirstNodeRange,
|
||||
setLastNodeRange
|
||||
} from "../util/selection";
|
||||
@ -1141,8 +1143,8 @@ export class Toolbar {
|
||||
const editElement = getContenteditableElement(nodeElement);
|
||||
if (Constants.SIYUAN_RENDER_CODE_LANGUAGES.includes(languageElement.textContent)) {
|
||||
nodeElement.dataset.content = editElement.textContent.trim();
|
||||
nodeElement.dataset.subtype = languageElement.textContent
|
||||
nodeElement.className = "render-node"
|
||||
nodeElement.dataset.subtype = languageElement.textContent;
|
||||
nodeElement.className = "render-node";
|
||||
nodeElement.innerHTML = `<div spin="1"></div><div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div>`;
|
||||
processRender(nodeElement);
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {genEmptyElement, insertEmptyBlock} from "../../block/util";
|
||||
import {getSelectionOffset, focusByWbr, setLastNodeRange, focusBlock, focusByRange} from "../util/selection";
|
||||
import {focusBlock, focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
|
||||
import {
|
||||
getContenteditableElement,
|
||||
getTopEmptyElement,
|
||||
@ -84,9 +84,9 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
|
||||
setStorageVal(Constants.LOCAL_CODELANG, window.siyuan.storage[Constants.LOCAL_CODELANG]);
|
||||
}
|
||||
if (Constants.SIYUAN_RENDER_CODE_LANGUAGES.includes(languageElement.textContent)) {
|
||||
blockElement.dataset.content = ""
|
||||
blockElement.dataset.subtype = languageElement.textContent
|
||||
blockElement.className = "render-node"
|
||||
blockElement.dataset.content = "";
|
||||
blockElement.dataset.subtype = languageElement.textContent;
|
||||
blockElement.className = "render-node";
|
||||
blockElement.innerHTML = `<div spin="1"></div><div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div>`;
|
||||
protyle.toolbar.showRender(protyle, blockElement);
|
||||
processRender(blockElement);
|
||||
|
Loading…
Reference in New Issue
Block a user