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) => {
|
export const updateOutlineEmoji = (unicode: string) => {
|
||||||
|
if (isMobile()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
getAllModels().outline.forEach(model => {
|
getAllModels().outline.forEach(model => {
|
||||||
model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
|
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") => {
|
export const updateFileTreeEmoji = (unicode: string, id: string, icon = "iconFile") => {
|
||||||
let emojiElement;
|
let emojiElement;
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
if (icon === "iconFile") {
|
emojiElement = document.querySelector(`#sidebar [data-type="sidebar-file"] [data-node-id="${id}"] .b3-list-item__icon`);
|
||||||
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`);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const files = getDockByType("file").data.file as Files;
|
const files = getDockByType("file").data.file as Files;
|
||||||
if (icon === "iconFile") {
|
if (icon === "iconFile") {
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ export class Files extends Model {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (target.parentElement.getAttribute("data-type") === "navigation-file") {
|
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 {
|
} else {
|
||||||
openEmojiPanel(target.parentElement.parentElement.getAttribute("data-url"), target, true);
|
openEmojiPanel(target.parentElement.parentElement.getAttribute("data-url"), target, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -235,8 +235,10 @@ export class Background {
|
||||||
id: protyle.block.rootID,
|
id: protyle.block.rootID,
|
||||||
attrs: {"icon": emoji}
|
attrs: {"icon": emoji}
|
||||||
});
|
});
|
||||||
|
if (protyle.model) {
|
||||||
protyle.model.parent.setDocIcon(emoji);
|
protyle.model.parent.setDocIcon(emoji);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue