mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 08:45:50 +01:00
scroll beyond last line in text/code editor, fixes #2728
This commit is contained in:
@@ -142,7 +142,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
|
||||
this.$widget.toggleClass("full-height",
|
||||
(
|
||||
!this.noteContext.hasNoteList()
|
||||
&& ['editableText', 'editableCode', 'canvas', 'webView', 'noteMap'].includes(this.type)
|
||||
&& ['canvas', 'webView', 'noteMap'].includes(this.type)
|
||||
&& this.mime !== 'text/x-sqlite;schema=trilium'
|
||||
)
|
||||
|| this.noteContext.viewScope.viewMode === 'attachments'
|
||||
@@ -191,12 +191,27 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
|
||||
}
|
||||
|
||||
async focusOnDetailEvent({ntxId}) {
|
||||
if (this.noteContext.ntxId === ntxId) {
|
||||
await this.refresh();
|
||||
if (this.noteContext.ntxId !== ntxId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const widget = this.getTypeWidget();
|
||||
await widget.initialized;
|
||||
widget.focus();
|
||||
await this.refresh();
|
||||
const widget = this.getTypeWidget();
|
||||
await widget.initialized;
|
||||
widget.focus();
|
||||
}
|
||||
|
||||
async scrollToEndEvent({ntxId}) {
|
||||
if (this.noteContext.ntxId !== ntxId) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.refresh();
|
||||
const widget = this.getTypeWidget();
|
||||
await widget.initialized;
|
||||
|
||||
if (widget.scrollToEnd) {
|
||||
widget.scrollToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user