mirror of
https://github.com/zadam/trilium.git
synced 2024-11-18 13:41:59 +08:00
41 lines
No EOL
998 B
JavaScript
41 lines
No EOL
998 B
JavaScript
import renderService from "./render.js";
|
|
|
|
class NoteDetailRender {
|
|
/**
|
|
* @param {TabContext} ctx
|
|
*/
|
|
constructor(ctx) {
|
|
this.ctx = ctx;
|
|
this.$component = ctx.$tabContent.find('.note-detail-render');
|
|
this.$noteDetailRenderHelp = ctx.$tabContent.find('.note-detail-render-help');
|
|
this.$noteDetailRenderContent = ctx.$tabContent.find('.note-detail-render-content');
|
|
this.$renderButton = ctx.$tabContent.find('.render-button');
|
|
|
|
this.$renderButton.click(() => this.render()); // long form!
|
|
}
|
|
|
|
async render() {
|
|
this.$component.show();
|
|
this.$noteDetailRenderHelp.hide();
|
|
|
|
await renderService.render(this.ctx.note, this.$noteDetailRenderContent, this.ctx);
|
|
}
|
|
|
|
getContent() {}
|
|
|
|
show() {}
|
|
|
|
focus() {}
|
|
|
|
onNoteChange() {}
|
|
|
|
cleanup() {
|
|
this.$noteDetailRenderContent.empty();
|
|
}
|
|
|
|
scrollToTop() {
|
|
this.$component.scrollTop(0);
|
|
}
|
|
}
|
|
|
|
export default NoteDetailRender; |