mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
e9f7cc0d52
commit
7879c7a72a
2 changed files with 21 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ import {escapeHtml} from "../util/escape";
|
|||
import {getWorkspaceName} from "../util/noRelyPCFunction";
|
||||
import {needSubscribe} from "../util/needSubscribe";
|
||||
import {redirectToCheckAuth, setNoteBook} from "../util/pathName";
|
||||
import {getAllModels} from "../layout/getAll";
|
||||
import {getAllEditor, getAllModels} from "../layout/getAll";
|
||||
import {reloadProtyle} from "../protyle/util/reload";
|
||||
import {Tab} from "../layout/Tab";
|
||||
import {setEmpty} from "../mobile/util/setEmpty";
|
||||
|
|
@ -144,6 +144,22 @@ export const reloadSync = (
|
|||
/// #endif
|
||||
};
|
||||
|
||||
export const setRefDynamicText = (data: {
|
||||
"blockID": string,
|
||||
"defBlockID": string,
|
||||
"refText": string,
|
||||
"rootID": string
|
||||
}) => {
|
||||
getAllEditor().forEach(item => {
|
||||
if (item.protyle.block.rootID === data.rootID) {
|
||||
const refElement = item.protyle.wysiwyg.element.querySelector(`[data-node-id="${data.blockID}"] span[data-type="block-ref"][data-subtype="d"][data-id="${data.defBlockID}"]`);
|
||||
if (refElement) {
|
||||
refElement.innerHTML = data.refText;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const lockScreen = (app: App) => {
|
||||
if (window.siyuan.config.readonly) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue