refactorings for add link and include note

This commit is contained in:
zadam
2020-02-16 10:50:48 +01:00
parent 7e41a2750c
commit e06f3ef97e
11 changed files with 65 additions and 42 deletions

View File

@@ -16,6 +16,7 @@ class AppContext {
this.tabManager = new TabManager(this);
this.components = [];
this.executors = [];
this.idToComponent = {};
}
async start() {
@@ -59,6 +60,18 @@ class AppContext {
this.trigger('initialRenderComplete');
}
registerComponent(componentId, component) {
this.idToComponent[componentId] = component;
}
findComponentById(componentId) {
return this.idToComponent[componentId];
}
getComponentByEl(el) {
return $(el).closest(".component").prop('component');
}
async trigger(name, data) {
this.eventReceived(name, data);