mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
75e5f8787f
commit
a138fc821b
3 changed files with 8 additions and 7 deletions
|
|
@ -392,6 +392,9 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
|
|||
};
|
||||
|
||||
export const updateOutlineEmoji = (unicode: string) => {
|
||||
if (isMobile()) {
|
||||
return;
|
||||
}
|
||||
getAllModels().outline.forEach(model => {
|
||||
model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
|
||||
});
|
||||
|
|
@ -400,11 +403,7 @@ export const updateOutlineEmoji = (unicode: string) => {
|
|||
export const updateFileTreeEmoji = (unicode: string, id: string, icon = "iconFile") => {
|
||||
let emojiElement;
|
||||
if (isMobile()) {
|
||||
if (icon === "iconFile") {
|
||||
emojiElement = document.querySelector(`#fileTree [data-node-id="${id}"] .b3-list-item__icon`);
|
||||
} else {
|
||||
emojiElement = document.querySelector(`#fileTree [data-node-id="${id}"] .b3-list-item__icon`) || document.querySelector(`#fileTree [data-url="${id}"] .b3-list-item__icon`);
|
||||
}
|
||||
emojiElement = document.querySelector(`#sidebar [data-type="sidebar-file"] [data-node-id="${id}"] .b3-list-item__icon`);
|
||||
} else {
|
||||
const files = getDockByType("file").data.file as Files;
|
||||
if (icon === "iconFile") {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ export class Files extends Model {
|
|||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (target.parentElement.getAttribute("data-type") === "navigation-file") {
|
||||
openEmojiPanel(target.parentElement.getAttribute("data-node-id"), target, false);
|
||||
openEmojiPanel(target.parentElement.getAttribute("data-node-id"), target);
|
||||
} else {
|
||||
openEmojiPanel(target.parentElement.parentElement.getAttribute("data-url"), target, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,9 @@ export class Background {
|
|||
id: protyle.block.rootID,
|
||||
attrs: {"icon": emoji}
|
||||
});
|
||||
protyle.model.parent.setDocIcon(emoji);
|
||||
if (protyle.model) {
|
||||
protyle.model.parent.setDocIcon(emoji);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue