mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🚨
This commit is contained in:
parent
c32d1fe09f
commit
17a619a55b
6 changed files with 7 additions and 8 deletions
|
|
@ -86,7 +86,7 @@ export const jumpToParent = (protyle: IProtyle, nodeElement: Element, type: "par
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id: targetId,
|
id: targetId,
|
||||||
action: [Constants.CB_GET_FOCUS, targetId !== protyle.block.rootID && protyle.block.showAll ? Constants.CB_GET_ALL : ""]
|
action: [Constants.CB_GET_FOCUS, targetId !== protyle.block.rootID && protyle.block.showAll ? Constants.CB_GET_ALL : ""]
|
||||||
})
|
});
|
||||||
/// #else
|
/// #else
|
||||||
openMobileFileById(protyle.app, targetId, [Constants.CB_GET_FOCUS, targetId !== protyle.block.rootID && protyle.block.showAll ? Constants.CB_GET_ALL : ""]);
|
openMobileFileById(protyle.app, targetId, [Constants.CB_GET_FOCUS, targetId !== protyle.block.rootID && protyle.block.showAll ? Constants.CB_GET_ALL : ""]);
|
||||||
/// #endif
|
/// #endif
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export const commandPanel = (app: App) => {
|
||||||
dialog.element.setAttribute("data-key", Constants.DIALOG_COMMANDPANEL);
|
dialog.element.setAttribute("data-key", Constants.DIALOG_COMMANDPANEL);
|
||||||
const listElement = dialog.element.querySelector("#commands");
|
const listElement = dialog.element.querySelector("#commands");
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
let html = ""
|
let html = "";
|
||||||
Object.keys(window.siyuan.config.keymap.general).forEach((key) => {
|
Object.keys(window.siyuan.config.keymap.general).forEach((key) => {
|
||||||
if (["addToDatabase"].includes(key)) {
|
if (["addToDatabase"].includes(key)) {
|
||||||
html += `<li class="b3-list-item" data-command="${key}">
|
html += `<li class="b3-list-item" data-command="${key}">
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export const openEditorTab = (app: App, ids: string[], notebookId?: string, path
|
||||||
zoomIn
|
zoomIn
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -83,7 +83,7 @@ export const openEditorTab = (app: App, ids: string[], notebookId?: string, path
|
||||||
zoomIn
|
zoomIn
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export const addFilesToDatabase = (fileLiElements: Element[]) => {
|
||||||
}]);
|
}]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
export const addEditorToDatabase = (protyle: IProtyle, range: Range, type?: string) => {
|
export const addEditorToDatabase = (protyle: IProtyle, range: Range, type?: string) => {
|
||||||
if (protyle.title?.editElement.contains(range.startContainer) || type === "title") {
|
if (protyle.title?.editElement.contains(range.startContainer) || type === "title") {
|
||||||
|
|
@ -100,4 +100,4 @@ export const addEditorToDatabase = (protyle: IProtyle, range: Range, type?: stri
|
||||||
focusByRange(range);
|
focusByRange(range);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import {addScript} from "../util/addScript";
|
||||||
import {Constants} from "../../constants";
|
import {Constants} from "../../constants";
|
||||||
import {focusByOffset} from "../util/selection";
|
import {focusByOffset} from "../util/selection";
|
||||||
import {setCodeTheme} from "../../util/assets";
|
import {setCodeTheme} from "../../util/assets";
|
||||||
import {hasClosestByClassName} from "../util/hasClosest";
|
|
||||||
|
|
||||||
export const highlightRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
|
export const highlightRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
|
||||||
let codeElements: NodeListOf<Element>;
|
let codeElements: NodeListOf<Element>;
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
|
||||||
hideElements(["util"], protyle);
|
hideElements(["util"], protyle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const blockType = blockElement.getAttribute("data-type")
|
const blockType = blockElement.getAttribute("data-type");
|
||||||
// 空代码块直接删除
|
// 空代码块直接删除
|
||||||
if (blockType === "NodeCodeBlock" && getContenteditableElement(blockElement).textContent.trim() === "") {
|
if (blockType === "NodeCodeBlock" && getContenteditableElement(blockElement).textContent.trim() === "") {
|
||||||
blockElement.classList.add("protyle-wysiwyg--select");
|
blockElement.classList.add("protyle-wysiwyg--select");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue