2019-10-05 16:55:29 +08:00
|
|
|
import renderService from "./render.js";
|
2018-03-28 09:36:01 +08:00
|
|
|
|
2019-05-04 06:16:41 +08:00
|
|
|
class NoteDetailRender {
|
|
|
|
/**
|
2019-05-09 01:55:24 +08:00
|
|
|
* @param {TabContext} ctx
|
2019-05-04 06:16:41 +08:00
|
|
|
*/
|
|
|
|
constructor(ctx) {
|
|
|
|
this.ctx = ctx;
|
2019-05-09 01:55:24 +08:00
|
|
|
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');
|
2019-05-04 06:16:41 +08:00
|
|
|
|
2019-05-20 03:52:28 +08:00
|
|
|
this.$renderButton.click(() => this.render()); // long form!
|
2019-05-04 06:16:41 +08:00
|
|
|
}
|
2018-05-27 07:27:47 +08:00
|
|
|
|
2019-05-12 18:58:55 +08:00
|
|
|
async render() {
|
2019-05-04 06:16:41 +08:00
|
|
|
this.$component.show();
|
2019-10-05 16:55:29 +08:00
|
|
|
this.$noteDetailRenderHelp.hide();
|
2018-05-27 07:27:47 +08:00
|
|
|
|
2019-10-05 16:55:29 +08:00
|
|
|
await renderService.render(this.ctx.note, this.$noteDetailRenderContent, this.ctx);
|
2018-05-27 07:27:47 +08:00
|
|
|
}
|
2018-05-27 07:58:08 +08:00
|
|
|
|
2019-05-04 06:16:41 +08:00
|
|
|
getContent() {}
|
|
|
|
|
2019-08-26 01:11:42 +08:00
|
|
|
show() {}
|
|
|
|
|
2019-05-04 06:16:41 +08:00
|
|
|
focus() {}
|
|
|
|
|
|
|
|
onNoteChange() {}
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
this.$noteDetailRenderContent.empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
scrollToTop() {
|
|
|
|
this.$component.scrollTop(0);
|
|
|
|
}
|
|
|
|
}
|
2018-05-27 07:27:47 +08:00
|
|
|
|
2019-05-04 06:16:41 +08:00
|
|
|
export default NoteDetailRender;
|