mirror of
https://github.com/zadam/trilium.git
synced 2024-11-18 05:35:56 +08:00
7539e6a616
# Conflicts: # src/services/consistency_checks.js
45 lines
No EOL
1.1 KiB
JavaScript
45 lines
No EOL
1.1 KiB
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.on('click', () => this.render()); // long form!
|
|
}
|
|
|
|
async render() {
|
|
this.$component.show();
|
|
this.$noteDetailRenderHelp.hide();
|
|
|
|
const renderNotesFound = await renderService.render(this.ctx.note, this.$noteDetailRenderContent, this.ctx);
|
|
|
|
if (!renderNotesFound) {
|
|
this.$noteDetailRenderHelp.show();
|
|
}
|
|
}
|
|
|
|
getContent() {}
|
|
|
|
show() {}
|
|
|
|
focus() {}
|
|
|
|
onNoteChange() {}
|
|
|
|
cleanup() {
|
|
this.$noteDetailRenderContent.empty();
|
|
}
|
|
|
|
scrollToTop() {
|
|
this.$component.scrollTop(0);
|
|
}
|
|
}
|
|
|
|
export default NoteDetailRender; |