display icon for non-supported note types in content renderer

This commit is contained in:
zadam 2023-05-30 22:52:48 +02:00
parent bf6106f4dc
commit 64aed9b462
2 changed files with 8 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "trilium", "name": "trilium",
"version": "0.60.0-beta", "version": "0.60.1-beta",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "trilium", "name": "trilium",
"version": "0.60.0-beta", "version": "0.60.1-beta",
"hasInstallScript": true, "hasInstallScript": true,
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {

View File

@ -157,9 +157,6 @@ async function getRenderedContent(note, options = {}) {
$renderedContent.append($("<div>").text("Error parsing content. Please check console.error() for more details.")); $renderedContent.append($("<div>").text("Error parsing content. Please check console.error() for more details."));
} }
} }
else if (type === 'book') {
// nothing, book doesn't have its own content
}
else if (!options.tooltip && type === 'protectedSession') { else if (!options.tooltip && type === 'protectedSession') {
const $button = $(`<button class="btn btn-sm"><span class="bx bx-log-in"></span> Enter protected session</button>`) const $button = $(`<button class="btn btn-sm"><span class="bx bx-log-in"></span> Enter protected session</button>`)
.on('click', protectedSessionService.enterProtectedSession); .on('click', protectedSessionService.enterProtectedSession);
@ -172,7 +169,12 @@ async function getRenderedContent(note, options = {}) {
); );
} }
else { else {
$renderedContent.append($("<p><em>Content of this note cannot be displayed in the book format</em></p>")); $renderedContent.append(
$("<div>")
.css("text-align", "center")
.css("font-size", "500%")
.append($("<span>").addClass(note.getIcon()))
);
} }
$renderedContent.addClass(note.getCssClass()); $renderedContent.addClass(note.getCssClass());