mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
tooltip for image note
This commit is contained in:
parent
9568fde027
commit
427234293e
@ -99,11 +99,21 @@ async function renderTooltip(note, attributes) {
|
|||||||
content += note.content;
|
content += note.content;
|
||||||
}
|
}
|
||||||
else if (note.type === 'code') {
|
else if (note.type === 'code') {
|
||||||
content += $("<pre>").text(note.content).prop('outerHTML');
|
content += $("<pre>")
|
||||||
|
.text(note.content)
|
||||||
|
.prop('outerHTML');
|
||||||
|
}
|
||||||
|
else if (note.type === 'image') {
|
||||||
|
content += $("<img>")
|
||||||
|
.prop("src", `/api/images/${note.noteId}/${note.title}`)
|
||||||
|
.prop("style", "max-width: 300px; max-height: 300px;")
|
||||||
|
.prop('outerHTML');
|
||||||
|
|
||||||
|
console.log(content);
|
||||||
}
|
}
|
||||||
// other types of notes don't have tooltip preview
|
// other types of notes don't have tooltip preview
|
||||||
|
|
||||||
if (!$(content).text().trim()) {
|
if (!$(content).text().trim() && note.type !== 'image') {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user