smaller fixes

This commit is contained in:
zadam 2020-01-25 18:29:32 +01:00
parent 48a7c0235f
commit 3f0974d3d2
6 changed files with 15 additions and 13 deletions

View file

@ -88,6 +88,12 @@ class AttributesWidget extends StandardWidget {
}
}
toggle(show) {
console.trace("attributes toggle", show);
super.toggle(show);
}
syncDataListener({data}) {
if (data.find(sd => sd.entityName === 'attributes' && sd.noteId === this.tabContext.note.noteId)) {
// no need to invalidate attributes since the Attribute class listens to this as well

View file

@ -10,8 +10,6 @@ class BasicWidget extends Component {
$widget.find("[data-trigger-event]").on('click', e => {
const eventName = $(e.target).attr('data-trigger-event');
console.log("Triggering " + eventName);
this.appContext.trigger(eventName);
});

View file

@ -36,9 +36,10 @@ export default class NoteDetailWidget extends TabAwareWidget {
this.typeWidgetPromises = {};
this.spacedUpdate = new SpacedUpdate(async () => {
const {noteFull} = this.tabContext;
const {noteId} = this.tabContext.note;
const {noteFull, note} = this.tabContext;
const {noteId} = note;
// FIXME hack
const dto = note.dto;
dto.content = noteFull.content = this.getTypeWidget().getContent();

View file

@ -1,7 +1,7 @@
import TabAwareWidget from "./tab_aware_widget.js";
const TPL = `
<div>
<div style="display: inline-flex;">
<button class="btn btn-sm icon-button bx bx-play-circle render-button"
title="Render"></button>

View file

@ -79,19 +79,12 @@ class StandardWidget extends TabAwareWidget {
this.$headerActions = this.$widget.find('.widget-header-actions');
this.$headerActions.append(...this.getHeaderActions());
// actual rendering is async
this.renderBody();
this.initialized = this.renderBody();
return this.$widget;
}
async renderBody() {
// if (!this.isExpanded() || this.rendered) {
// return;
// }
//
// this.rendered = true;
await this.doRenderBody();
}

View file

@ -37,6 +37,10 @@ export default class TabCachingWidget extends TabAwareWidget {
}
widget.toggle(true);
// stop propagation of the event to the children, individual tab widget should not know about tab switching
// since they are per-tab
return false;
}
tabRemovedListener({tabId}) {