mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
463e2fa4cd
commit
f23cd5005d
2 changed files with 8 additions and 6 deletions
|
|
@ -267,7 +267,7 @@ export const openEmojiPanel = (id: string, target: HTMLElement, isNotebook = fal
|
||||||
addEmoji(unicode);
|
addEmoji(unicode);
|
||||||
updateFileTreeEmoji(unicode, id);
|
updateFileTreeEmoji(unicode, id);
|
||||||
updateFileEmoji(unicode, id);
|
updateFileEmoji(unicode, id);
|
||||||
updateOutlineEmoji(unicode);
|
updateOutlineEmoji(unicode, id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -357,7 +357,7 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
updateFileTreeEmoji("", id);
|
updateFileTreeEmoji("", id);
|
||||||
updateFileEmoji("", id);
|
updateFileEmoji("", id);
|
||||||
updateOutlineEmoji("");
|
updateOutlineEmoji("", id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -387,7 +387,7 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
|
||||||
addEmoji(unicode);
|
addEmoji(unicode);
|
||||||
updateFileTreeEmoji(unicode, id);
|
updateFileTreeEmoji(unicode, id);
|
||||||
updateFileEmoji(unicode, id);
|
updateFileEmoji(unicode, id);
|
||||||
updateOutlineEmoji(unicode);
|
updateOutlineEmoji(unicode, id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -395,10 +395,12 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateOutlineEmoji = (unicode: string) => {
|
export const updateOutlineEmoji = (unicode: string, id:string) => {
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
getAllModels().outline.forEach(model => {
|
getAllModels().outline.forEach(model => {
|
||||||
model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
|
if (model.blockId === id) {
|
||||||
|
model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
/// #endif
|
/// #endif
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ export class Background {
|
||||||
this.ial.icon = emoji;
|
this.ial.icon = emoji;
|
||||||
this.render(this.ial, protyle.block.rootID);
|
this.render(this.ial, protyle.block.rootID);
|
||||||
updateFileTreeEmoji(emoji, protyle.block.rootID);
|
updateFileTreeEmoji(emoji, protyle.block.rootID);
|
||||||
updateOutlineEmoji(emoji);
|
updateOutlineEmoji(emoji, protyle.block.rootID);
|
||||||
fetchPost("/api/attr/setBlockAttrs", {
|
fetchPost("/api/attr/setBlockAttrs", {
|
||||||
id: protyle.block.rootID,
|
id: protyle.block.rootID,
|
||||||
attrs: {"icon": emoji}
|
attrs: {"icon": emoji}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue