mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-22 23:14:07 +01:00
This commit is contained in:
parent
81224760da
commit
a593bc7503
4 changed files with 13 additions and 5 deletions
|
|
@ -380,9 +380,13 @@ export const globalShortcut = () => {
|
|||
}).forEach(item => {
|
||||
let icon = `<svg class="b3-list-item__graphic"><use xlink:href="#${item.icon}"></use></svg>`;
|
||||
let rootId = "";
|
||||
const initData = item.headElement.getAttribute("data-initdata")
|
||||
if (item.model instanceof Editor) {
|
||||
rootId = ` data-node-id="${item.model.editor.protyle.block.rootID}"`;
|
||||
icon = unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__graphic", true);
|
||||
} else if (initData) {
|
||||
rootId = ` data-node-id="${JSON.parse(initData).rootId}"`;
|
||||
icon = unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__graphic", true);
|
||||
}
|
||||
tabHtml += `<li data-id="${item.id}"${rootId} class="b3-list-item${currentId === item.id ? " b3-list-item--focus" : ""}"${currentId === item.id ? ' data-original="true"' : ""}>${icon}<span class="b3-list-item__text">${escapeHtml(item.title)}</span></li>`;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath: string
|
|||
<span class="b3-list-item__toggle b3-list-item__toggle--hl">
|
||||
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
|
||||
</span>
|
||||
<span class="b3-list-item__graphic">${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_NOTE)}</span>
|
||||
${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__text">${escapeHtml(item.name)}</span>
|
||||
</li></ul>`;
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@ export const movePathTo = (paths?: string[], range?: Range, cb?: (toPath: string
|
|||
let fileHTML = "";
|
||||
data.data.forEach((item: { boxIcon: string, box: string, hPath: string, path: string }) => {
|
||||
fileHTML += `<li style="padding: 4px" class="b3-list-item${fileHTML === "" ? " b3-list-item--focus" : ""}" data-path="${item.path}" data-box="${item.box}">
|
||||
<span class="b3-list-item__graphic">${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE)}</span>
|
||||
${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)}
|
||||
<span class="b3-list-item__showall">${escapeHtml(item.hPath)}</span>
|
||||
</li>`;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue