components now track their parent

This commit is contained in:
zadam
2020-02-15 09:43:47 +01:00
parent 9337564075
commit 6d847d22d3
14 changed files with 66 additions and 58 deletions
@@ -47,7 +47,7 @@ class AppContext {
];
if (utils.isElectron()) {
this.components.push(new ZoomService(this));
this.components.push(new ZoomService(this, this));
import("./spell_check.js").then(spellCheckService => spellCheckService.initSpellCheck());
}
@@ -8,8 +8,8 @@ import appContext from "./app_context.js";
import Component from "../widgets/component.js";
export default class Entrypoints extends Component {
constructor(appContext) {
super(appContext);
constructor(appContext, parent) {
super(appContext, parent);
// hot keys are active also inside inputs and content editables
jQuery.hotkeys.options.filterInputAcceptingElements = false;
@@ -15,7 +15,7 @@ class TabContext extends Component {
* @param {string|null} tabId
*/
constructor(appContext, tabId = null) {
super(appContext);
super(appContext, parent);
this.tabId = tabId || utils.randomString(4);
@@ -8,8 +8,8 @@ import utils from "./utils.js";
import TabContext from "./tab_context.js";
export default class TabManager extends Component {
constructor(appContext) {
super(appContext);
constructor(appContext, parent) {
super(appContext, parent);
this.activeTabId = null;
+2 -2
View File
@@ -5,8 +5,8 @@ const MIN_ZOOM = 0.5;
const MAX_ZOOM = 2.0;
export default class ZoomService extends Component {
constructor(appContext) {
super(appContext);
constructor(appContext, parent) {
super(appContext, parent);
this.setZoomFactor(options.getFloat('zoomFactor'));
}