This commit is contained in:
zadam 2020-02-27 14:35:12 +01:00
parent 5e3c85f891
commit cd4b1235a7
12 changed files with 11 additions and 73 deletions

View File

@ -40,13 +40,13 @@ export default class TabCachingWidget extends TabAwareWidget {
if (!widget) {
widget = this.widgets[this.tabContext.tabId] = this.widgetFactory();
this.child(widget);
const $renderedWidget = widget.render();
keyboardActionsService.updateDisplayedShortcuts($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});
}

View File

@ -293,15 +293,7 @@ export default class BookTypeWidget extends TypeWidget {
}
}
getContent() {}
focus() {}
cleanup() {
this.$content.empty();
}
scrollToTop() {
this.$widget.scrollTop(0);
}
}

View File

@ -132,8 +132,4 @@ export default class CodeTypeWidget extends TypeWidget {
});
}
}
scrollToTop() {
this.$widget.scrollTop(0);
}
}

View File

@ -38,12 +38,4 @@ export default class EmptyTypeWidget extends TypeWidget {
doRefresh(note) {
this.$autoComplete.trigger('focus');
}
getContent() {}
focus() {}
cleanup() {}
scrollToTop() {}
}

View File

@ -144,12 +144,4 @@ export default class FileTypeWidget extends TypeWidget {
getFileUrl() {
return utils.getUrlForDownload("api/notes/" + this.noteId + "/download");
}
getContent() {}
focus() {}
cleanup() {}
scrollToTop() {}
}

View File

@ -147,16 +147,6 @@ class ImageTypeWidget extends TypeWidget {
getFileUrl() {
return utils.getUrlForDownload(`api/notes/${this.noteId}/download`);
}
getContent() {}
focus() {}
cleanup() {}
scrollToTop() {
this.$widget.scrollTop(0);
}
}
export default ImageTypeWidget

View File

@ -39,14 +39,4 @@ export default class ProtectedSessionTypeWidget extends TypeWidget {
return this.$widget;
}
getContent() {}
focus() {}
cleanup() {}
scrollToTop() {
this.$widget.scrollTop(0);
}
}

View File

@ -640,8 +640,4 @@ export default class RelationMapTypeWidget extends TypeWidget {
getContent() {
return JSON.stringify(this.mapData);
}
focus() {}
scrollToTop() {}
}

View File

@ -37,15 +37,7 @@ export default class RenderTypeWidget extends TypeWidget {
}
}
getContent() {}
focus() {}
cleanup() {
this.$noteDetailRenderContent.empty();
}
scrollToTop() {
this.$widget.scrollTop(0);
}
}

View File

@ -48,10 +48,4 @@ export default class SearchTypeWidget extends TypeWidget {
searchString: this.$searchString.val()
});
}
focus() {}
cleanup() {}
scrollToTop() {}
}

View File

@ -186,10 +186,6 @@ export default class TextTypeWidget extends TypeWidget {
}
}
scrollToTop() {
this.$widget.scrollTop(0);
}
insertDateTimeToTextCommand() {
const date = new Date();
const dateString = utils.formatDateTime(date);

View File

@ -28,4 +28,12 @@ export default class TypeWidget extends TabAwareWidget {
isActive() {
return this.$widget.is(":visible");
}
getContent() {}
focus() {}
scrollToTop() {
this.$widget.scrollTop(0);
}
}