fixes, cleaned up noise in the developer console

This commit is contained in:
zadam
2020-02-08 10:40:58 +01:00
parent 9acf723a9a
commit 81f4966a1a
12 changed files with 45 additions and 36 deletions

View File

@@ -32,6 +32,18 @@ export default class CalendarWidget extends CollapsibleWidget {
&& this.note.hasOwnedLabel("dateNote");
}
setTabContextListener({tabContext}) {
super.setTabContextListener({tabContext});
console.log("set tab context", tabContext.tabId, "to", this.componentId);
}
async refresh() {
super.refresh();
//console.trace("tab", this.tabContext.tabId);
}
async doRenderBody() {
await libraryLoader.requireLibrary(libraryLoader.CALENDAR_WIDGET);

View File

@@ -28,7 +28,7 @@ export default class Component {
const end = Date.now();
if (end - start > 10) {
if (end - start > 10 && glob.PROFILING_LOG) {
console.log(`Event ${name} in component ${this.componentId} took ${end-start}ms`);
}

View File

@@ -44,7 +44,7 @@ export default class TabAwareWidget extends BasicWidget {
}
async isEnabled() {
return !!this.note;
return !!this.note && this.tabContext.isActive();
}
async refresh() {
@@ -56,7 +56,7 @@ export default class TabAwareWidget extends BasicWidget {
const end = Date.now();
if (end - start > 10) {
if (glob.PROFILING_LOG && end - start > 10) {
console.log(`Refresh of ${this.componentId} took ${end-start}ms`);
}
}

View File

@@ -409,12 +409,6 @@ export default class TabRowWidget extends BasicWidget {
});
}
get activeTabId() {
const tabEl = this.activeTabEl;
return tabEl ? tabEl.getAttribute('data-tab-id') : null;
}
get activeTabEl() {
return this.$widget.find('.note-tab[active]')[0];
}