Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(store): state if there is a focused page element can not be set …
Browse files Browse the repository at this point in the history
…and read from store
  • Loading branch information
Lasse Küchler committed Dec 14, 2017
1 parent d4afbae commit 127ddd8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -84,6 +85,10 @@ export class Store {
return this.selectedElement;
}

public getElementFocus(): boolean | undefined {
return this.elementHasFocus;
}

public getStyleGuidePath(): string {
return this.styleGuidePath;
}
Expand Down Expand Up @@ -166,4 +171,8 @@ export class Store {
public unsetSelectedElement(): void {
this.selectedElement = undefined;
}

public setElementFocus(state: boolean): void {
this.elementHasFocus = state;
}
}

0 comments on commit 127ddd8

Please sign in to comment.