mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
edited notes doesn't wrap long note titles
This commit is contained in:
parent
9447d3f9b5
commit
d406df48a8
@ -3,6 +3,23 @@ import linkService from "../../services/link.js";
|
|||||||
import server from "../../services/server.js";
|
import server from "../../services/server.js";
|
||||||
import treeCache from "../../services/tree_cache.js";
|
import treeCache from "../../services/tree_cache.js";
|
||||||
|
|
||||||
|
const TPL = `
|
||||||
|
<div class="edited-notes-widget">
|
||||||
|
<style>
|
||||||
|
.edited-notes-widget ul {
|
||||||
|
padding-left: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edited-notes-widget ul li {
|
||||||
|
white-space: nowrap;
|
||||||
|
list-style-position:inside;
|
||||||
|
overflow-x: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
export default class EditedNotesWidget extends CollapsibleWidget {
|
export default class EditedNotesWidget extends CollapsibleWidget {
|
||||||
get widgetTitle() { return "Edited notes on this day"; }
|
get widgetTitle() { return "Edited notes on this day"; }
|
||||||
|
|
||||||
@ -17,6 +34,11 @@ export default class EditedNotesWidget extends CollapsibleWidget {
|
|||||||
&& this.note.hasOwnedLabel("dateNote");
|
&& this.note.hasOwnedLabel("dateNote");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async doRenderBody() {
|
||||||
|
this.$body.html(TPL);
|
||||||
|
this.$editedNotes = this.$body.find('.edited-notes-widget');
|
||||||
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshWithNote(note) {
|
||||||
// remember which title was when we found the similar notes
|
// remember which title was when we found the similar notes
|
||||||
this.title = note.title;
|
this.title = note.title;
|
||||||
@ -36,10 +58,15 @@ export default class EditedNotesWidget extends CollapsibleWidget {
|
|||||||
const $list = $('<ul>');
|
const $list = $('<ul>');
|
||||||
|
|
||||||
for (const editedNote of editedNotes) {
|
for (const editedNote of editedNotes) {
|
||||||
const $item = $("<li>");
|
const $item = $('<li>');
|
||||||
|
|
||||||
if (editedNote.isDeleted) {
|
if (editedNote.isDeleted) {
|
||||||
$item.append($("<i>").text(editedNote.title + " (deleted)"));
|
const title = editedNote.title + " (deleted)";
|
||||||
|
$item.append(
|
||||||
|
$("<i>")
|
||||||
|
.text(title)
|
||||||
|
.attr("title", title)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$item.append(editedNote.notePath ? await linkService.createNoteLink(editedNote.notePath.join("/"), {showNotePath: true}) : editedNote.title);
|
$item.append(editedNote.notePath ? await linkService.createNoteLink(editedNote.notePath.join("/"), {showNotePath: true}) : editedNote.title);
|
||||||
@ -48,6 +75,6 @@ export default class EditedNotesWidget extends CollapsibleWidget {
|
|||||||
$list.append($item);
|
$list.append($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$body.empty().append($list);
|
this.$editedNotes.empty().append($list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,11 @@ import utils from "../services/utils.js";
|
|||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="quick-search input-group input-group-sm" style="width: 250px;">
|
<div class="quick-search input-group input-group-sm" style="width: 250px;">
|
||||||
<style>
|
<style>
|
||||||
|
.quick-search {
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.quick-search .dropdown-menu {
|
.quick-search .dropdown-menu {
|
||||||
max-height: 600px;
|
max-height: 600px;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user