fix issues

This commit is contained in:
zadam 2020-02-27 12:41:15 +01:00
parent b2a3e1cc04
commit 5e3c85f891
3 changed files with 18 additions and 19 deletions

View File

@ -31,6 +31,7 @@ export default class Layout {
return new FlexContainer('column') return new FlexContainer('column')
.setParent(appContext) .setParent(appContext)
.id('root-widget') .id('root-widget')
.css('height', '100vh')
.child(new FlexContainer('row') .child(new FlexContainer('row')
.child(new GlobalMenuWidget()) .child(new GlobalMenuWidget())
.child(new TabRowWidget()) .child(new TabRowWidget())

View File

@ -27,25 +27,25 @@ export default class TabAwareWidget extends BasicWidget {
return this.tabContext && this.tabContext.notePath; return this.tabContext && this.tabContext.notePath;
} }
tabNoteSwitchedEvent({tabId, notePath}) { async tabNoteSwitchedEvent({tabId, notePath}) {
// if notePath does not match then the tabContext has been switched to another note in the mean time // if notePath does not match then the tabContext has been switched to another note in the mean time
if (this.isTab(tabId) && this.notePath === notePath) { if (this.isTab(tabId) && this.notePath === notePath) {
this.noteSwitched(); await this.noteSwitched();
} }
} }
noteTypeMimeChangedEvent({noteId}) { async noteTypeMimeChangedEvent({noteId}) {
if (this.noteId === noteId) { if (this.noteId === noteId) {
this.refresh(); await this.refresh();
} }
} }
noteSwitched() { async noteSwitched() {
this.refresh(); await this.refresh();
} }
activeTabChanged() { async activeTabChanged() {
this.refresh(); await this.refresh();
} }
isEnabled() { isEnabled() {
@ -70,30 +70,30 @@ export default class TabAwareWidget extends BasicWidget {
} }
} }
refreshWithNote(note, notePath) {} async refreshWithNote(note, notePath) {}
activeTabChangedEvent() { async activeTabChangedEvent() {
this.tabContext = appContext.tabManager.getActiveTabContext(); this.tabContext = appContext.tabManager.getActiveTabContext();
this.activeTabChanged(); await this.activeTabChanged();
} }
// when note is both switched and activated, this should not produce double refresh // when note is both switched and activated, this should not produce double refresh
tabNoteSwitchedAndActivatedEvent() { async tabNoteSwitchedAndActivatedEvent() {
this.tabContext = appContext.tabManager.getActiveTabContext(); this.tabContext = appContext.tabManager.getActiveTabContext();
this.refresh(); await this.refresh();
} }
treeCacheReloadedEvent() { async treeCacheReloadedEvent() {
this.refresh(); await this.refresh();
} }
lazyLoadedEvent() { async lazyLoadedEvent() {
if (!this.tabContext) { // has not been loaded yet if (!this.tabContext) { // has not been loaded yet
this.tabContext = appContext.tabManager.getActiveTabContext(); this.tabContext = appContext.tabManager.getActiveTabContext();
} }
this.refresh(); await this.refresh();
} }
} }

View File

@ -32,8 +32,6 @@ export default class RenderTypeWidget extends TypeWidget {
const renderNotesFound = await renderService.render(note, this.$noteDetailRenderContent); const renderNotesFound = await renderService.render(note, this.$noteDetailRenderContent);
console.trace("render");
if (!renderNotesFound) { if (!renderNotesFound) {
this.$noteDetailRenderHelp.show(); this.$noteDetailRenderHelp.show();
} }