mirror of https://github.com/TriliumNext/Notes
added ScrollingContainer to guarantee scrolling to top when switching notes
parent
135b4fe88e
commit
9dd95b62a9
@ -0,0 +1,18 @@
|
|||||||
|
import Container from "./container.js";
|
||||||
|
|
||||||
|
export default class ScrollingContainer extends Container {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.css('height: 100%; overflow: auto;');
|
||||||
|
}
|
||||||
|
|
||||||
|
async tabNoteSwitchedEvent({tabContext, notePath}) {
|
||||||
|
// if notePath does not match then the tabContext has been switched to another note in the mean time
|
||||||
|
if (tabContext.notePath === notePath) {
|
||||||
|
console.log("SCROLLING");
|
||||||
|
|
||||||
|
this.$widget.scrollTop(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue