mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 02:05:53 +01:00
fix scroll to top for read only / editable text note after switching note
This commit is contained in:
@@ -65,10 +65,6 @@ export default class ReadOnlyTextTypeWidget extends AbstractTextTypeWidget {
|
||||
this.$content.html('');
|
||||
}
|
||||
|
||||
scrollToTop() {
|
||||
this.$content.scrollTop(0);
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
const noteComplement = await treeCache.getNoteComplement(note.noteId);
|
||||
|
||||
|
||||
@@ -25,6 +25,12 @@ export default class TypeWidget extends TabAwareWidget {
|
||||
}
|
||||
}
|
||||
|
||||
async noteSwitched() {
|
||||
this.scrollToTop();
|
||||
|
||||
await super.noteSwitched();
|
||||
}
|
||||
|
||||
isActive() {
|
||||
return this.$widget.is(":visible");
|
||||
}
|
||||
@@ -54,4 +60,4 @@ export default class TypeWidget extends TabAwareWidget {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user