mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
wip
This commit is contained in:
parent
5e3c85f891
commit
cd4b1235a7
@ -40,13 +40,13 @@ export default class TabCachingWidget extends TabAwareWidget {
|
|||||||
|
|
||||||
if (!widget) {
|
if (!widget) {
|
||||||
widget = this.widgets[this.tabContext.tabId] = this.widgetFactory();
|
widget = this.widgets[this.tabContext.tabId] = this.widgetFactory();
|
||||||
this.child(widget);
|
|
||||||
|
|
||||||
const $renderedWidget = widget.render();
|
const $renderedWidget = widget.render();
|
||||||
keyboardActionsService.updateDisplayedShortcuts($renderedWidget);
|
|
||||||
|
|
||||||
this.$widget.after($renderedWidget);
|
this.$widget.after($renderedWidget);
|
||||||
|
|
||||||
|
keyboardActionsService.updateDisplayedShortcuts($renderedWidget);
|
||||||
|
|
||||||
|
this.child(widget); // add as child only once it is ready (also rendered)
|
||||||
widget.handleEvent('setTabContext', {tabContext: this.tabContext});
|
widget.handleEvent('setTabContext', {tabContext: this.tabContext});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,15 +293,7 @@ export default class BookTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent() {}
|
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
this.$content.empty();
|
this.$content.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToTop() {
|
|
||||||
this.$widget.scrollTop(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -132,8 +132,4 @@ export default class CodeTypeWidget extends TypeWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToTop() {
|
|
||||||
this.$widget.scrollTop(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -38,12 +38,4 @@ export default class EmptyTypeWidget extends TypeWidget {
|
|||||||
doRefresh(note) {
|
doRefresh(note) {
|
||||||
this.$autoComplete.trigger('focus');
|
this.$autoComplete.trigger('focus');
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent() {}
|
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {}
|
|
||||||
|
|
||||||
scrollToTop() {}
|
|
||||||
}
|
}
|
@ -144,12 +144,4 @@ export default class FileTypeWidget extends TypeWidget {
|
|||||||
getFileUrl() {
|
getFileUrl() {
|
||||||
return utils.getUrlForDownload("api/notes/" + this.noteId + "/download");
|
return utils.getUrlForDownload("api/notes/" + this.noteId + "/download");
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent() {}
|
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {}
|
|
||||||
|
|
||||||
scrollToTop() {}
|
|
||||||
}
|
}
|
@ -147,16 +147,6 @@ class ImageTypeWidget extends TypeWidget {
|
|||||||
getFileUrl() {
|
getFileUrl() {
|
||||||
return utils.getUrlForDownload(`api/notes/${this.noteId}/download`);
|
return utils.getUrlForDownload(`api/notes/${this.noteId}/download`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent() {}
|
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {}
|
|
||||||
|
|
||||||
scrollToTop() {
|
|
||||||
this.$widget.scrollTop(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ImageTypeWidget
|
export default ImageTypeWidget
|
@ -39,14 +39,4 @@ export default class ProtectedSessionTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
return this.$widget;
|
return this.$widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent() {}
|
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {}
|
|
||||||
|
|
||||||
scrollToTop() {
|
|
||||||
this.$widget.scrollTop(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -640,8 +640,4 @@ export default class RelationMapTypeWidget extends TypeWidget {
|
|||||||
getContent() {
|
getContent() {
|
||||||
return JSON.stringify(this.mapData);
|
return JSON.stringify(this.mapData);
|
||||||
}
|
}
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
scrollToTop() {}
|
|
||||||
}
|
}
|
@ -37,15 +37,7 @@ export default class RenderTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent() {}
|
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
this.$noteDetailRenderContent.empty();
|
this.$noteDetailRenderContent.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToTop() {
|
|
||||||
this.$widget.scrollTop(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -48,10 +48,4 @@ export default class SearchTypeWidget extends TypeWidget {
|
|||||||
searchString: this.$searchString.val()
|
searchString: this.$searchString.val()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
focus() {}
|
|
||||||
|
|
||||||
cleanup() {}
|
|
||||||
|
|
||||||
scrollToTop() {}
|
|
||||||
}
|
}
|
@ -186,10 +186,6 @@ export default class TextTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToTop() {
|
|
||||||
this.$widget.scrollTop(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
insertDateTimeToTextCommand() {
|
insertDateTimeToTextCommand() {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const dateString = utils.formatDateTime(date);
|
const dateString = utils.formatDateTime(date);
|
||||||
|
@ -28,4 +28,12 @@ export default class TypeWidget extends TabAwareWidget {
|
|||||||
isActive() {
|
isActive() {
|
||||||
return this.$widget.is(":visible");
|
return this.$widget.is(":visible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getContent() {}
|
||||||
|
|
||||||
|
focus() {}
|
||||||
|
|
||||||
|
scrollToTop() {
|
||||||
|
this.$widget.scrollTop(0);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user