From 127ddd8739308c0f2fb15f31506585512ed805dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20K=C3=BCchler?= Date: Thu, 14 Dec 2017 10:54:29 +0100 Subject: [PATCH] feat(store): state if there is a focused page element can not be set and read from store --- src/store/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/store/index.ts b/src/store/index.ts index 40cec7acf..31e56cfad 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -16,6 +16,7 @@ export class Store { @MobX.observable private projects: Project[] = []; @MobX.observable private patternRoot: PatternFolder; @MobX.observable private selectedElement?: PageElement | undefined; + @MobX.observable private elementHasFocus?: boolean = false; @MobX.observable private styleGuidePath: string; public addProject(project: Project): void { @@ -84,6 +85,10 @@ export class Store { return this.selectedElement; } + public getElementFocus(): boolean | undefined { + return this.elementHasFocus; + } + public getStyleGuidePath(): string { return this.styleGuidePath; } @@ -166,4 +171,8 @@ export class Store { public unsetSelectedElement(): void { this.selectedElement = undefined; } + + public setElementFocus(state: boolean): void { + this.elementHasFocus = state; + } }